Browse Source

Have dedicated directory for controller component, with own Makefile

vitsch
Michel Roelofs 9 years ago
parent
commit
225b800fd6
177 changed files with 171 additions and 65 deletions
  1. +50
    -65
      controller/Makefile
  2. +39
    -0
      controller/build.mk
  3. +82
    -0
      controller/controller/Makefile
  4. +0
    -0
      controller/controller/block_add.c
  5. +0
    -0
      controller/controller/block_add.h
  6. +0
    -0
      controller/controller/block_and2.c
  7. +0
    -0
      controller/controller/block_and2.h
  8. +0
    -0
      controller/controller/block_and2.il
  9. +0
    -0
      controller/controller/block_bridge_pwm.c
  10. +0
    -0
      controller/controller/block_counter.c
  11. +0
    -0
      controller/controller/block_debug.c
  12. +0
    -0
      controller/controller/block_debug.h
  13. +0
    -0
      controller/controller/block_decoder_uint32_bool.c
  14. +0
    -0
      controller/controller/block_filter_iir.c
  15. +0
    -0
      controller/controller/block_filter_iir.h
  16. +0
    -0
      controller/controller/block_filter_lp.c
  17. +0
    -0
      controller/controller/block_filter_lp.h
  18. +0
    -0
      controller/controller/block_friction.c
  19. +0
    -0
      controller/controller/block_friction.h
  20. +0
    -0
      controller/controller/block_gain.c
  21. +0
    -0
      controller/controller/block_gain.h
  22. +0
    -0
      controller/controller/block_gain_var.c
  23. +0
    -0
      controller/controller/block_joystick.c
  24. +0
    -0
      controller/controller/block_limit.c
  25. +0
    -0
      controller/controller/block_limit.h
  26. +0
    -0
      controller/controller/block_limit_2nd.c
  27. +0
    -0
      controller/controller/block_limit_2nd.h
  28. +0
    -0
      controller/controller/block_limit_dyn.c
  29. +0
    -0
      controller/controller/block_limit_dyn.h
  30. +0
    -0
      controller/controller/block_limit_var.c
  31. +0
    -0
      controller/controller/block_limit_var.h
  32. +0
    -0
      controller/controller/block_list.sh
  33. +0
    -0
      controller/controller/block_matrix_2x2.c
  34. +0
    -0
      controller/controller/block_matrix_2x2.h
  35. +0
    -0
      controller/controller/block_multiplexer.c
  36. +0
    -0
      controller/controller/block_not.c
  37. +0
    -0
      controller/controller/block_not.h
  38. +0
    -0
      controller/controller/block_not.il
  39. +0
    -0
      controller/controller/block_or2.c
  40. +0
    -0
      controller/controller/block_or2.h
  41. +0
    -0
      controller/controller/block_or2.il
  42. +0
    -0
      controller/controller/block_or3.c
  43. +0
    -0
      controller/controller/block_or3.h
  44. +0
    -0
      controller/controller/block_or3.il
  45. +0
    -0
      controller/controller/block_or4.c
  46. +0
    -0
      controller/controller/block_or4.h
  47. +0
    -0
      controller/controller/block_or4.il
  48. +0
    -0
      controller/controller/block_pid.c
  49. +0
    -0
      controller/controller/block_pid.h
  50. +0
    -0
      controller/controller/block_pid_aw.c
  51. +0
    -0
      controller/controller/block_pid_aw.h
  52. +0
    -0
      controller/controller/block_quantize.c
  53. +0
    -0
      controller/controller/block_quantize.h
  54. +0
    -0
      controller/controller/block_random.c
  55. +0
    -0
      controller/controller/block_random.h
  56. +0
    -0
      controller/controller/block_register.c
  57. +0
    -0
      controller/controller/block_register.h
  58. +0
    -0
      controller/controller/block_register.il
  59. +0
    -0
      controller/controller/block_servo_state.c
  60. +0
    -0
      controller/controller/block_servo_state.h
  61. +0
    -0
      controller/controller/block_setpoint_generator.c
  62. +0
    -0
      controller/controller/block_setpoint_generator.h
  63. +0
    -0
      controller/controller/block_setreset.c
  64. +0
    -0
      controller/controller/block_setreset.h
  65. +0
    -0
      controller/controller/block_setreset.il
  66. +0
    -0
      controller/controller/block_sine.c
  67. +0
    -0
      controller/controller/block_sine.h
  68. +0
    -0
      controller/controller/block_subtract.c
  69. +0
    -0
      controller/controller/block_subtract.h
  70. +0
    -0
      controller/controller/block_switch.c
  71. +0
    -0
      controller/controller/block_switch.h
  72. +0
    -0
      controller/controller/block_trajectplayer.c
  73. +0
    -0
      controller/controller/block_trajectplayer.h
  74. +0
    -0
      controller/controller/block_trigger.c
  75. +0
    -0
      controller/controller/block_value.c
  76. +0
    -0
      controller/controller/block_value.h
  77. +0
    -0
      controller/controller/block_value_bool.c
  78. +0
    -0
      controller/controller/block_value_bool.h
  79. +0
    -0
      controller/controller/block_value_uint32.c
  80. +0
    -0
      controller/controller/controller_block.c
  81. +0
    -0
      controller/controller/controller_block.h
  82. +0
    -0
      controller/controller/controller_dumpdot.c
  83. +0
    -0
      controller/controller/controller_dumpdot.h
  84. +0
    -0
      controller/controller/controller_load.c
  85. +0
    -0
      controller/controller/controller_load.h
  86. +0
    -0
      controller/controller/controller_load_parser.l
  87. +0
    -0
      controller/controller/controller_load_parser.y
  88. +0
    -0
      controller/controller/controller_sample.c
  89. +0
    -0
      controller/controller/controller_sample.h
  90. +0
    -0
      controller/controller/controller_setpoint_command.c
  91. +0
    -0
      controller/controller/controller_setpoint_command.h
  92. +0
    -0
      controller/controller/controller_trace.c
  93. +0
    -0
      controller/controller/controller_trace.h
  94. +0
    -0
      controller/controller/il2c/Makefile
  95. +0
    -0
      controller/controller/il2c/il.l
  96. +0
    -0
      controller/controller/il2c/il.y
  97. +0
    -0
      controller/controller/il2c/il.yy.h
  98. +0
    -0
      controller/controller/il2c/il2c.c
  99. +0
    -0
      controller/controller/il2c/il2c.h
  100. +0
    -0
      controller/controller/il2c/test/Makefile

+ 50
- 65
controller/Makefile View File

@ -1,82 +1,67 @@
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

+ 39
- 0
controller/build.mk View File

@ -0,0 +1,39 @@
# 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)

+ 82
- 0
controller/controller/Makefile View File

@ -0,0 +1,82 @@
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

controller/block_add.c → controller/controller/block_add.c View File


controller/block_add.h → controller/controller/block_add.h View File


controller/block_and2.c → controller/controller/block_and2.c View File


controller/block_and2.h → controller/controller/block_and2.h View File


controller/block_and2.il → controller/controller/block_and2.il View File


controller/block_bridge_pwm.c → controller/controller/block_bridge_pwm.c View File


controller/block_counter.c → controller/controller/block_counter.c View File


controller/block_debug.c → controller/controller/block_debug.c View File


controller/block_debug.h → controller/controller/block_debug.h View File


controller/block_decoder_uint32_bool.c → controller/controller/block_decoder_uint32_bool.c View File


controller/block_filter_iir.c → controller/controller/block_filter_iir.c View File


controller/block_filter_iir.h → controller/controller/block_filter_iir.h View File


controller/block_filter_lp.c → controller/controller/block_filter_lp.c View File


controller/block_filter_lp.h → controller/controller/block_filter_lp.h View File


controller/block_friction.c → controller/controller/block_friction.c View File


controller/block_friction.h → controller/controller/block_friction.h View File


controller/block_gain.c → controller/controller/block_gain.c View File


controller/block_gain.h → controller/controller/block_gain.h View File


controller/block_gain_var.c → controller/controller/block_gain_var.c View File


controller/block_joystick.c → controller/controller/block_joystick.c View File


controller/block_limit.c → controller/controller/block_limit.c View File


controller/block_limit.h → controller/controller/block_limit.h View File


controller/block_limit_2nd.c → controller/controller/block_limit_2nd.c View File


controller/block_limit_2nd.h → controller/controller/block_limit_2nd.h View File


controller/block_limit_dyn.c → controller/controller/block_limit_dyn.c View File


controller/block_limit_dyn.h → controller/controller/block_limit_dyn.h View File


controller/block_limit_var.c → controller/controller/block_limit_var.c View File


controller/block_limit_var.h → controller/controller/block_limit_var.h View File


controller/block_list.sh → controller/controller/block_list.sh View File


controller/block_matrix_2x2.c → controller/controller/block_matrix_2x2.c View File


controller/block_matrix_2x2.h → controller/controller/block_matrix_2x2.h View File


controller/block_multiplexer.c → controller/controller/block_multiplexer.c View File


controller/block_not.c → controller/controller/block_not.c View File


controller/block_not.h → controller/controller/block_not.h View File


controller/block_not.il → controller/controller/block_not.il View File


controller/block_or2.c → controller/controller/block_or2.c View File


controller/block_or2.h → controller/controller/block_or2.h View File


controller/block_or2.il → controller/controller/block_or2.il View File


controller/block_or3.c → controller/controller/block_or3.c View File


controller/block_or3.h → controller/controller/block_or3.h View File


controller/block_or3.il → controller/controller/block_or3.il View File


controller/block_or4.c → controller/controller/block_or4.c View File


controller/block_or4.h → controller/controller/block_or4.h View File


controller/block_or4.il → controller/controller/block_or4.il View File


controller/block_pid.c → controller/controller/block_pid.c View File


controller/block_pid.h → controller/controller/block_pid.h View File


controller/block_pid_aw.c → controller/controller/block_pid_aw.c View File


controller/block_pid_aw.h → controller/controller/block_pid_aw.h View File


controller/block_quantize.c → controller/controller/block_quantize.c View File


controller/block_quantize.h → controller/controller/block_quantize.h View File


controller/block_random.c → controller/controller/block_random.c View File


controller/block_random.h → controller/controller/block_random.h View File


controller/block_register.c → controller/controller/block_register.c View File


controller/block_register.h → controller/controller/block_register.h View File


controller/block_register.il → controller/controller/block_register.il View File


controller/block_servo_state.c → controller/controller/block_servo_state.c View File


controller/block_servo_state.h → controller/controller/block_servo_state.h View File


controller/block_setpoint_generator.c → controller/controller/block_setpoint_generator.c View File


controller/block_setpoint_generator.h → controller/controller/block_setpoint_generator.h View File


controller/block_setreset.c → controller/controller/block_setreset.c View File


controller/block_setreset.h → controller/controller/block_setreset.h View File


controller/block_setreset.il → controller/controller/block_setreset.il View File


controller/block_sine.c → controller/controller/block_sine.c View File


controller/block_sine.h → controller/controller/block_sine.h View File


controller/block_subtract.c → controller/controller/block_subtract.c View File


controller/block_subtract.h → controller/controller/block_subtract.h View File


controller/block_switch.c → controller/controller/block_switch.c View File


controller/block_switch.h → controller/controller/block_switch.h View File


controller/block_trajectplayer.c → controller/controller/block_trajectplayer.c View File


controller/block_trajectplayer.h → controller/controller/block_trajectplayer.h View File


controller/block_trigger.c → controller/controller/block_trigger.c View File


controller/block_value.c → controller/controller/block_value.c View File


controller/block_value.h → controller/controller/block_value.h View File


controller/block_value_bool.c → controller/controller/block_value_bool.c View File


controller/block_value_bool.h → controller/controller/block_value_bool.h View File


controller/block_value_uint32.c → controller/controller/block_value_uint32.c View File


controller/controller_block.c → controller/controller/controller_block.c View File


controller/controller_block.h → controller/controller/controller_block.h View File


controller/controller_dumpdot.c → controller/controller/controller_dumpdot.c View File


controller/controller_dumpdot.h → controller/controller/controller_dumpdot.h View File


controller/controller_load.c → controller/controller/controller_load.c View File


controller/controller_load.h → controller/controller/controller_load.h View File


controller/controller_load_parser.l → controller/controller/controller_load_parser.l View File


controller/controller_load_parser.y → controller/controller/controller_load_parser.y View File


controller/controller_sample.c → controller/controller/controller_sample.c View File


controller/controller_sample.h → controller/controller/controller_sample.h View File


controller/controller_setpoint_command.c → controller/controller/controller_setpoint_command.c View File


controller/controller_setpoint_command.h → controller/controller/controller_setpoint_command.h View File


controller/controller_trace.c → controller/controller/controller_trace.c View File


controller/controller_trace.h → controller/controller/controller_trace.h View File


controller/il2c/Makefile → controller/controller/il2c/Makefile View File


controller/il2c/il.l → controller/controller/il2c/il.l View File


controller/il2c/il.y → controller/controller/il2c/il.y View File


controller/il2c/il.yy.h → controller/controller/il2c/il.yy.h View File


controller/il2c/il2c.c → controller/controller/il2c/il2c.c View File


controller/il2c/il2c.h → controller/controller/il2c/il2c.h View File


controller/il2c/test/Makefile → controller/controller/il2c/test/Makefile View File


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save