C_runtime/Makefile
author Edouard Tisserant <edouard.tisserant@gmail.com>
Wed, 13 Nov 2024 23:10:36 +0100
changeset 4037 4127c64df073
parent 3949 f64dce4e2f62
child 4044 2a4b8b59d165
permissions -rw-r--r--
python runtime: update ServicePublisher to current Zeroconf API
3937
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     1
# Builds standalone C/C++ Beremiz runtime
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     2
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     3
# This Makefile is based on fragments of eRPC Makefiles
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     4
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     5
APP_NAME = beremiz_runtime
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     6
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     7
RUNTIME_ROOT = $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     8
ERPC_ROOT ?= $(abspath $(RUNTIME_ROOT)/../../erpc)
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     9
ERPC_C_ROOT = $(ERPC_ROOT)/erpc_c
3940
934bd46a7500 C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3937
diff changeset
    10
BEREMIZ_ROOT = $(abspath $(RUNTIME_ROOT)/..)
934bd46a7500 C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3937
diff changeset
    11
MATIEC_ROOT ?= $(abspath $(RUNTIME_ROOT)/../../matiec)
3937
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    12
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    13
INCLUDES += $(ERPC_C_ROOT)/infra \
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    14
            $(ERPC_C_ROOT)/port \
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    15
            $(ERPC_C_ROOT)/setup \
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    16
            $(ERPC_C_ROOT)/transports \
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    17
            $(ERPC_ROOT)/test/common/config \
3940
934bd46a7500 C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3937
diff changeset
    18
            $(ERPC_ROOT)/erpcgen/src \
934bd46a7500 C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3937
diff changeset
    19
            $(BEREMIZ_ROOT)/targets \
934bd46a7500 C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3937
diff changeset
    20
            $(MATIEC_ROOT)/lib/C
3937
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    21
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    22
INCLUDES := $(foreach includes, $(INCLUDES), -I $(includes))
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    23
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    24
ERPC_SOURCES += $(ERPC_ROOT)/erpcgen/src/format_string.cpp \
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    25
                $(ERPC_ROOT)/erpcgen/src/Logging.cpp \
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    26
                $(ERPC_ROOT)/erpcgen/src/options.cpp \
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    27
                $(ERPC_C_ROOT)/infra/erpc_arbitrated_client_manager.cpp \
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    28
                $(ERPC_C_ROOT)/infra/erpc_basic_codec.cpp \
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    29
                $(ERPC_C_ROOT)/infra/erpc_client_manager.cpp \
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    30
                $(ERPC_C_ROOT)/infra/erpc_crc16.cpp \
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    31
                $(ERPC_C_ROOT)/infra/erpc_server.cpp \
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    32
                $(ERPC_C_ROOT)/infra/erpc_simple_server.cpp \
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    33
                $(ERPC_C_ROOT)/infra/erpc_framed_transport.cpp \
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    34
                $(ERPC_C_ROOT)/infra/erpc_message_buffer.cpp \
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    35
                $(ERPC_C_ROOT)/infra/erpc_message_loggers.cpp \
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    36
                $(ERPC_C_ROOT)/infra/erpc_transport_arbitrator.cpp \
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    37
                $(ERPC_C_ROOT)/infra/erpc_utils.cpp \
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    38
                $(ERPC_C_ROOT)/port/erpc_port_stdlib.cpp \
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    39
                $(ERPC_C_ROOT)/port/erpc_threading_pthreads.cpp \
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    40
                $(ERPC_C_ROOT)/port/erpc_serial.cpp \
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    41
                $(ERPC_C_ROOT)/transports/erpc_serial_transport.cpp \
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    42
                $(ERPC_C_ROOT)/transports/erpc_tcp_transport.cpp
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    43
			
3949
f64dce4e2f62 C runtime: initial fixes. Now runs and traces first_steps example.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3940
diff changeset
    44
SOURCES +=  $(RUNTIME_ROOT)/erpc_PLCObject_client.cpp \
3937
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    45
            $(RUNTIME_ROOT)/erpc_PLCObject_interface.cpp \
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    46
            $(RUNTIME_ROOT)/erpc_PLCObject_server.cpp \
3940
934bd46a7500 C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3937
diff changeset
    47
			$(RUNTIME_ROOT)/md5.cpp \
934bd46a7500 C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3937
diff changeset
    48
			$(RUNTIME_ROOT)/blob.cpp \
3937
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    49
			$(RUNTIME_ROOT)/posix_main.cpp \
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    50
			$(RUNTIME_ROOT)/PLCObject.cpp
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    51
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    52
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    53
# get version from version.py
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    54
BEREMIZ_VERSION := $(shell python3 $(RUNTIME_ROOT)/../version.py)
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    55
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    56
CXXFLAGS += -std=gnu++17 -Wunused-variable -Wno-deprecated-register -Wno-narrowing -Werror -DBEREMIZ_VERSION=$(BEREMIZ_VERSION)
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    57
# CFLAGS += -Os -DNDEBUG
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    58
CXXFLAGS += -g3 -O0 -DDEBUG
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    59
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    60
LIBRARIES += -lpthread -lrt -lc -lm
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    61
LD = $(CXX)
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    62
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    63
OBJS_ROOT = $(RUNTIME_ROOT)/build
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    64
SOURCES_ABS := $(foreach s,$(SOURCES),$(abspath $(s)))
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    65
SOURCES_REL := $(subst $(RUNTIME_ROOT)/,,$(SOURCES_ABS))
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    66
SOURCE_DIRS_ABS := $(sort $(foreach f,$(SOURCES_ABS),$(dir $(f))))
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    67
SOURCE_DIRS_REL := $(subst $(RUNTIME_ROOT)/,,$(SOURCE_DIRS_ABS))
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    68
CXX_SOURCES = $(filter %.cpp,$(SOURCES_REL))
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    69
OBJECTS_CXX := $(addprefix $(OBJS_ROOT)/,$(CXX_SOURCES:.cpp=.o))
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    70
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    71
$(OBJS_ROOT)/%.o: $(RUNTIME_ROOT)/%.cpp
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    72
	@echo Compiling $(subst $(RUNTIME_ROOT)/,,$<)
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    73
	$(CXX) $(CXXFLAGS) $(INCLUDES) -MMD -MF $(basename $@).d -MP -o $@ -c $<
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    74
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    75
ERPC_OBJS_ROOT = $(RUNTIME_ROOT)/erpcbuild
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    76
ERPC_SOURCES_ABS := $(foreach s,$(ERPC_SOURCES),$(abspath $(s)))
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    77
ERPC_SOURCES_REL := $(subst $(ERPC_ROOT)/,,$(ERPC_SOURCES_ABS))
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    78
ERPC_SOURCE_DIRS_ABS := $(sort $(foreach f,$(ERPC_SOURCES_ABS),$(dir $(f))))
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    79
ERPC_SOURCE_DIRS_REL := $(subst $(ERPC_ROOT)/,,$(ERPC_SOURCE_DIRS_ABS))
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    80
ERPC_CXX_SOURCES = $(filter %.cpp,$(ERPC_SOURCES_REL))
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    81
ERPC_OBJECTS_CXX := $(addprefix $(ERPC_OBJS_ROOT)/,$(ERPC_CXX_SOURCES:.cpp=.o))
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    82
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    83
$(ERPC_OBJS_ROOT)/%.o: $(ERPC_ROOT)/%.cpp
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    84
	@echo Compiling, $(subst $(ERPC_ROOT)/,,$<)
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    85
	$(CXX) $(CXXFLAGS) $(INCLUDES) -MMD -MF $(basename $@).d -MP -o $@ -c $<
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    86
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    87
OBJECTS_ALL := $(sort $(ERPC_OBJECTS_CXX) $(OBJECTS_CXX))
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    88
OBJECTS_DIRS := $(OBJS_ROOT) $(addprefix $(OBJS_ROOT)/,$(SOURCE_DIRS_REL)) $(ERPC_OBJS_ROOT) $(addprefix $(ERPC_OBJS_ROOT)/,$(ERPC_SOURCE_DIRS_REL))
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    89
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    90
.PHONY: all $(APP_NAME)
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    91
all: $(APP_NAME) $(OBJECTS_DIRS)
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    92
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    93
$(OBJECTS_DIRS) :
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    94
	mkdir -p $@
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    95
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    96
$(OBJECTS_ALL): | $(OBJECTS_DIRS)
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    97
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    98
$(APP_NAME): $(OBJECTS_ALL)
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    99
	@echo Linking, $(APP_NAME)
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   100
	$(LD) $(LDFLAGS) \
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   101
		$(OBJECTS_ALL) \
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   102
		-o $@ \
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   103
		$(LIBRARIES)
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   104
	@echo "Output binary:" ; echo "  $(APP_NAME)"
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   105
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   106
.PHONY: clean
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   107
clean::
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   108
	@echo "Cleaning $(APP_NAME)"
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   109
	rm -rf $(OBJECTS_ALL) $(OBJECTS_DIRS) $(APP_NAME)
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   110
e13543d716b6 C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   111
-include $(OBJECTS_ALL:.o=.d)