You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

91 lines
1.8 KiB

LIBDIR:=$(DIR)/lib
CLEAN += $(DIR)/lib/.libs
CTRL_BLOCKS :=
CTRL_BLOCK_LIBS :=
CTRL_TESTS :=
CTRL_TRIGGERS :=
CTRL_TRIGGER_LIBS :=
$(eval $(call SUBDIR,controller))
$(eval $(call SUBDIR,shell))
$(eval $(call SUBDIR,block))
$(eval $(call SUBDIR,trigger))
ifdef BUILD_ETHERCAT
$(eval $(call SUBDIR,ec))
endif
$(eval $(call SUBDIR,packet))
ifdef BUILD_TEST
$(eval $(call SUBDIR,test))
endif
ifdef BUILD_VESP
$(eval $(call SUBDIR,vesp))
endif
ifdef BUILD_AM335X
$(eval $(call SUBDIR,am335x))
endif
ifdef BUILD_ATSAMX70
$(eval $(call SUBDIR,atsamx70))
endif
DT_CTRL_TARGETS += $(DIR)/dt_ctrl
DT_CTRL_SRCS := $(DIR)/dt_ctrl.c
DT_CTRL_OBJS := $(DT_CTRL_SRCS:.c=.o)
ifdef BUILD_EMBEDDED
DT_CTRL_OBJS += $(DIR)/ctrl_embedded.o
endif
, := ,
BLOCKS := $(addprefix -Wl$(,)-u -Wl$(,)block_,$(addsuffix _create_struct,$(CTRL_BLOCKS)))
BLOCKS += $(addprefix -Wl$(,)-u -Wl$(,)block_,$(addsuffix _create,$(CTRL_BLOCKS)))
BLOCKS += $(subst .la,,$(subst lib,-l,$(CTRL_BLOCK_LIBS)))
TRIGGERS := $(addprefix -Wl$(,)-u -Wl$(,)trigger_,$(addsuffix _create_struct,$(CTRL_TRIGGERS)))
TRIGGERS += $(subst .la,,$(subst lib,-l,$(CTRL_TRIGGER_LIBS)))
$(DIR)/dt_ctrl: \
libcontroller.la \
liblog.la \
$(CTRL_BLOCK_LIBS) \
$(CTRL_TRIGGER_LIBS)
$(DIR)/dt_ctrl_CFLAGS += -Wall -O3
$(DIR)/dt_ctrl_LDFLAGS += \
-Wl,-E \
-lcontroller \
-llog \
$(BLOCKS) \
$(TRIGGERS)
$(DIR)/dt_ctrl: $(DT_CTRL_OBJS)
ifdef BUILD_TCP
$(DIR)/dt_ctrl: \
libshell.la
$(DIR)/dt_ctrl_LDFLAGS += \
-lshell
endif
# Make test reports as part of the test target
DT_CTRL_TESTS := $(CTRL_TESTS)
DT_CTRL := $(DIR)/dt_ctrl
test: $(DIR)/test.output
$(DIR)/test.output: $(DT_CTRL_TESTS)
$(DT_CTRL_TESTS): $(DT_CTRL)
%.test.output: %.test.ctrl
@echo "DT_CTRL $<"
@$(DT_CTRL) $< >$@ || (rm $@ && false)
SRCS += $(DT_CTRL_SRCS)
TARGETS += $(DT_CTRL_TARGETS)
CLEAN += $(DT_CTRL_TARGETS) $(DT_CTRL_OBJS) $(DT_CTRL_TESTS)