Commit 225b800f authored by Michel Roelofs's avatar Michel Roelofs
Browse files

Have dedicated directory for controller component, with own Makefile

parent 1d392b5f
include build.mk
IL2C=il2c/il2c
CFLAGS= -Wall -O3 \
-I. \
-Icontroller \
-I../common/utils \
-I../common/trace \
-Idt_azimuth -Idt_elevation -Iec -Ishell -Ilog
LDFLAGS= -lpthread -lrt -lm -ldl -Wl,-E
CFLAGS_SIM=-DUSE_AZ_SIM -DUSE_EL_SIM
CFLAGS= -Wall -O3 -I../log/ -I..
BLOCKSRCS= \
block_add.c \
block_and2.c \
block_bridge_pwm.c \
block_counter.c \
block_debug.c \
block_decoder_uint32_bool.c \
block_filter_iir.c \
block_filter_lp.c \
block_friction.c \
block_gain.c \
block_gain_var.c \
block_joystick.c \
block_limit.c \
block_limit_dyn.c \
block_limit_2nd.c \
block_limit_var.c \
block_matrix_2x2.c \
block_multiplexer.c \
block_not.c \
block_or2.c \
block_or3.c \
block_or4.c \
block_pid.c \
block_pid_aw.c \
block_quantize.c \
block_random.c \
block_register.c \
block_setpoint_generator.c \
block_setreset.c \
block_servo_state.c \
block_sine.c \
block_subtract.c \
block_switch.c \
block_trajectplayer.c \
block_trigger.c \
block_value.c \
block_value_bool.c \
block_value_uint32.c
ARCHIVES= \
dt_azimuth/dt_azimuth.a \
dt_elevation/dt_elevation.a \
controller/controller.a \
log/log.a \
ec/ec.a \
shell/shell.a \
../common/trace/trace.a \
../common/utils/utils.a
CONTROLLERSRCS= \
controller_block.c \
controller_setpoint_command.c \
controller_trace.c \
controller_sample.c \
controller_dumpdot.c \
controller_load.c \
controller_load_parser.tab.c \
controller_load_parser.yy.c
dt_ctrl_sim_LDFLAGS=`controller/block_list.sh dt_azimuth/dt_azimuth.a dt_elevation/dt_elevation.a controller/controller.a`
dt_ctrl_LDFLAGS=$(dt_ctrl_sim_LDFLAGS) `controller/block_list.sh ec/ec.a`
all: dt_ctrl dt_ctrl_sim \
trace_list trace_view \
test
SRCS= $(CONTROLLERSRCS) $(BLOCKSRCS)
dt_ctrl: dt_ctrl.o $(ARCHIVES)
BLOCKS=$(BLOCKSRCS:.c=.o)
dt_ctrl_sim: dt_ctrl_sim.o $(ARCHIVES)
CONTROLLER= $(CONTROLLERSRCS:.c=.o)
dt_ctrl_sim.o: dt_ctrl.c
@echo "COMPILE: dt_ctrl.c (OUTPUT: dt_ctrl_sim.o)"
@$(CC) $(CFLAGS) $(CFLAGS_SIM) dt_ctrl.c -c -o dt_ctrl_sim.o
trace_list: trace_list.o $(ARCHIVES)
all: il2cdir $(BLOCKS) $(CONTROLLER) controllerlib
trace_view: trace_view.o $(ARCHIVES)
%.a:
@echo " SUBDIR: $(@D)"
@$(MAKE) -C $(@D)
controller_load_parser.tab.o: controller_load_parser.yy.c
ec/ec.a: log/log.a shell/shell.a
controller_load.o: controller_load_parser.tab.h controller_load_parser.yy.h
il2cdir:
test:
@echo " SUBDIR: $@"
@$(MAKE) -C il2c
@$(MAKE) -C test
.PHONY: il2cdir
controllerlib: controller.a($(BLOCKS) $(CONTROLLER))
.PHONY: test
clean:
rm -rf *.o *.a *.yy.* *.tab.* *.d
@$(MAKE) -C il2c clean
include ../build.mk
rm -f *.o *.d
rm -f dt_az dt_az_ctrl \
command_shell \
trace_list trace_view \
dt_ctrl \
dt_ctrl_sim
$(MAKE) -C controller clean
$(MAKE) -C dt_azimuth clean
$(MAKE) -C dt_elevation clean
$(MAKE) -C ec clean
$(MAKE) -C test clean
$(MAKE) -C shell clean
$(MAKE) -C log clean
# Some make rules to make output pretty....
# default ARFLAGS also has 'v', but we don't want it to be verbose.
ARFLAGS= -r
# make sure libs from /usr/local/lib are found
VPATH= /lib64 /usr/lib64 /usr/local/lib64 /lib /usr/lib /usr/local/lib
%.o : %.c
@echo " CC $<"
@$(CC) -MD $(CFLAGS) -c $<
%: %.o
@echo " LD $@"
@$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) $($@_LDFLAGS) -o $@
(%): %
@echo " AR $< in $@"
@$(AR) $(ARFLAGS) $@ $<
%.tab.c %.tab.h: %.y
@echo "BISON $<"
@bison -d $<
%.yy.c: %.l %.tab.h
@echo " FLEX $<"
@flex -o $@ $<
# il2c: instruction list 2 c 'compiler'
%.c %.h: %.il
@echo " IL2C $<"
@$(IL2C) $<
# dot -> pdf
%.pdf: %.dot
@echo " DOT $<"
@dot $< -o $@ -Tpdf
-include $(SRCS:.c=.d)
IL2C=il2c/il2c
CFLAGS= -Wall -O3 -I../log/ -I..
BLOCKSRCS= \
block_add.c \
block_and2.c \
block_bridge_pwm.c \
block_counter.c \
block_debug.c \
block_decoder_uint32_bool.c \
block_filter_iir.c \
block_filter_lp.c \
block_friction.c \
block_gain.c \
block_gain_var.c \
block_joystick.c \
block_limit.c \
block_limit_dyn.c \
block_limit_2nd.c \
block_limit_var.c \
block_matrix_2x2.c \
block_multiplexer.c \
block_not.c \
block_or2.c \
block_or3.c \
block_or4.c \
block_pid.c \
block_pid_aw.c \
block_quantize.c \
block_random.c \
block_register.c \
block_setpoint_generator.c \
block_setreset.c \
block_servo_state.c \
block_sine.c \
block_subtract.c \
block_switch.c \
block_trajectplayer.c \
block_trigger.c \
block_value.c \
block_value_bool.c \
block_value_uint32.c
CONTROLLERSRCS= \
controller_block.c \
controller_setpoint_command.c \
controller_trace.c \
controller_sample.c \
controller_dumpdot.c \
controller_load.c \
controller_load_parser.tab.c \
controller_load_parser.yy.c
SRCS= $(CONTROLLERSRCS) $(BLOCKSRCS)
BLOCKS=$(BLOCKSRCS:.c=.o)
CONTROLLER= $(CONTROLLERSRCS:.c=.o)
all: il2cdir $(BLOCKS) $(CONTROLLER) controllerlib
controller_load_parser.tab.o: controller_load_parser.yy.c
controller_load.o: controller_load_parser.tab.h controller_load_parser.yy.h
il2cdir:
@echo " SUBDIR: $@"
@$(MAKE) -C il2c
.PHONY: il2cdir
controllerlib: controller.a($(BLOCKS) $(CONTROLLER))
clean:
rm -rf *.o *.a *.yy.* *.tab.* *.d
@$(MAKE) -C il2c clean
include ../build.mk
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment