build.mk 2.06 KB
Newer Older
Jeroen Vreeken's avatar
Jeroen Vreeken committed
1

2
BLOCK_TARGETS := $(LIBDIR)/libblock.la
Jeroen Vreeken's avatar
Jeroen Vreeken committed
3
4
5

$(eval $(call SUBDIR,il2c))

Jeroen Vreeken's avatar
Jeroen Vreeken committed
6
7
8
BLOCKS := \
	add \
	bridge_pwm \
Jeroen Vreeken's avatar
Jeroen Vreeken committed
9
	command_bool \
10
	command_float \
Jeroen Vreeken's avatar
Jeroen Vreeken committed
11
12
13
14
15
16
17
18
19
20
21
22
23
	counter \
	debug \
	decoder_uint32_bool \
	filter_iir \
	filter_lp \
	friction \
	gain \
	gain_var \
	inverse_proportional \
	limit \
	limit_dyn \
	limit_2nd \
	limit_var \
24
	log \
Jeroen Vreeken's avatar
Jeroen Vreeken committed
25
26
	matrix_2x2 \
	multiplexer \
27
	pand \
Jeroen Vreeken's avatar
Jeroen Vreeken committed
28
29
30
31
32
33
	pid \
	pid_aw \
	quadrature_decoder \
	quantize \
	random \
	rangecheck \
34
35
	setpoint_generator_1d \
	setpoint_generator_3d \
Jeroen Vreeken's avatar
Jeroen Vreeken committed
36
37
38
39
40
41
42
43
44
	servo_state \
	sine \
	state_machine \
	subtract \
	switch \
	trajectplayer \
	trigger \
	value \
	value_bool \
Daan Vreeken's avatar
Daan Vreeken committed
45
	value_uint32 \
Daan Vreeken's avatar
Daan Vreeken committed
46
	comparator \
47
48
	schmitt_trigger \
	oneshot
Jeroen Vreeken's avatar
Jeroen Vreeken committed
49

Jeroen Vreeken's avatar
Jeroen Vreeken committed
50
51
52
53
54
55
56
57
BLOCKS_IL := \
	and2 \
	not \
	or2 \
	or3 \
	or4 \
	register \
	setreset
Jeroen Vreeken's avatar
Jeroen Vreeken committed
58
59

ifneq ($(OS), FreeBSD)
Jeroen Vreeken's avatar
Jeroen Vreeken committed
60
61
BLOCKS+= \
	joystick
Jeroen Vreeken's avatar
Jeroen Vreeken committed
62
63
endif

Jeroen Vreeken's avatar
Jeroen Vreeken committed
64
65
66
67
68
69
BLOCK_SRCS_IL := $(addsuffix .il,$(addprefix $(DIR)/block_,$(BLOCKS_IL)))

$(BLOCK_SRCS_IL): $(IL2C)

BLOCK_SRCS := $(addsuffix .c,$(addprefix $(DIR)/block_,$(BLOCKS))) \
	$(BLOCK_SRCS_IL)
Jeroen Vreeken's avatar
Jeroen Vreeken committed
70

Jeroen Vreeken's avatar
Jeroen Vreeken committed
71
72
73
74
BLOCK_OBJSC := $(BLOCK_SRCS:.c=.lo)
BLOCK_OBJS := $(BLOCK_OBJSC:.il=.il2c.lo)


75
$(BLOCK_OBJS): CFLAGS += -O3 -Wall
Jeroen Vreeken's avatar
Jeroen Vreeken committed
76
77
$(LIBDIR)/libblock.la_LDFLAGS += -lm -lcontroller -llog
$(LIBDIR)/libblock.la: libcontroller.la liblog.la
Jeroen Vreeken's avatar
Jeroen Vreeken committed
78
79
80
$(LIBDIR)/libblock.la: $(BLOCK_OBJS)
	$(LIB_LINK)

Jeroen Vreeken's avatar
Jeroen Vreeken committed
81
82
CTRL_BLOCKS += $(BLOCKS) $(BLOCKS_IL)
CTRL_BLOCK_LIBS += libblock.la
Jeroen Vreeken's avatar
Jeroen Vreeken committed
83
84

TARGETS += $(BLOCK_TARGETS)
Jeroen Vreeken's avatar
Jeroen Vreeken committed
85
CLEAN += $(BLOCK_TARGETS) $(BLOCK_OBJS) $(BLOCK_OBJS:.lo=.o)
Jeroen Vreeken's avatar
Jeroen Vreeken committed
86
SRCS += $(BLOCK_SRCS)
Jeroen Vreeken's avatar
Jeroen Vreeken committed
87
88

CTRL_TESTS += \
Jeroen Vreeken's avatar
Jeroen Vreeken committed
89
	$(DIR)/block_bridge_pwm.test.ctrl \
Jeroen Vreeken's avatar
Jeroen Vreeken committed
90
	$(DIR)/block_command_bool.test.ctrl \
91
	$(DIR)/block_command_float.test.ctrl \
Jeroen Vreeken's avatar
Jeroen Vreeken committed
92
	$(DIR)/block_gain.test.ctrl \
Jeroen Vreeken's avatar
Jeroen Vreeken committed
93
	$(DIR)/block_limit.test.ctrl \
Jeroen Vreeken's avatar
Jeroen Vreeken committed
94
	$(DIR)/block_limit_var.test.ctrl \
95
	$(DIR)/block_log.test.ctrl \
Jeroen Vreeken's avatar
Jeroen Vreeken committed
96
	$(DIR)/block_matrix_2x2.test.ctrl \
Jeroen Vreeken's avatar
Jeroen Vreeken committed
97
	$(DIR)/block_not.test.ctrl \
Jeroen Vreeken's avatar
Jeroen Vreeken committed
98
	$(DIR)/block_oneshot.test.ctrl \
99
	$(DIR)/block_pid_aw.test.ctrl \
Jeroen Vreeken's avatar
Jeroen Vreeken committed
100
	$(DIR)/block_rangecheck.test.ctrl \
Jeroen Vreeken's avatar
Jeroen Vreeken committed
101
	$(DIR)/block_setpoint_generator_1d.test.ctrl \
Jeroen Vreeken's avatar
Jeroen Vreeken committed
102
103
	$(DIR)/block_setpoint_generator_3d.test.ctrl \
	$(DIR)/block_servo_state.test.ctrl \
104
	$(DIR)/block_state_machine.test.ctrl \
105
	$(DIR)/block_quadrature_decoder.test.ctrl \
Jeroen Vreeken's avatar
Jeroen Vreeken committed
106
	$(DIR)/block_quantize.test.ctrl
Jeroen Vreeken's avatar
Jeroen Vreeken committed
107