build.mk 1.77 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 \
Jeroen Vreeken's avatar
Jeroen Vreeken committed
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
	counter \
	debug \
	decoder_uint32_bool \
	filter_iir \
	filter_lp \
	friction \
	gain \
	gain_var \
	inverse_proportional \
	limit \
	limit_dyn \
	limit_2nd \
	limit_var \
	matrix_2x2 \
	multiplexer \
25
	pand \
Jeroen Vreeken's avatar
Jeroen Vreeken committed
26
27
28
29
30
31
	pid \
	pid_aw \
	quadrature_decoder \
	quantize \
	random \
	rangecheck \
32
33
	setpoint_generator_1d \
	setpoint_generator_3d \
Jeroen Vreeken's avatar
Jeroen Vreeken committed
34
35
36
37
38
39
40
41
42
43
	servo_state \
	sine \
	state_machine \
	subtract \
	switch \
	trajectplayer \
	trigger \
	value \
	value_bool \
	value_uint32
Jeroen Vreeken's avatar
Jeroen Vreeken committed
44

Jeroen Vreeken's avatar
Jeroen Vreeken committed
45
46
47
48
49
50
51
52
BLOCKS_IL := \
	and2 \
	not \
	or2 \
	or3 \
	or4 \
	register \
	setreset
Jeroen Vreeken's avatar
Jeroen Vreeken committed
53
54

ifneq ($(OS), FreeBSD)
Jeroen Vreeken's avatar
Jeroen Vreeken committed
55
56
BLOCKS+= \
	joystick
Jeroen Vreeken's avatar
Jeroen Vreeken committed
57
58
endif

Jeroen Vreeken's avatar
Jeroen Vreeken committed
59
60
61
62
63
64
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
65

Jeroen Vreeken's avatar
Jeroen Vreeken committed
66
67
68
69
BLOCK_OBJSC := $(BLOCK_SRCS:.c=.lo)
BLOCK_OBJS := $(BLOCK_OBJSC:.il=.il2c.lo)


70
$(BLOCK_OBJS): CFLAGS += -O3 -Wall
Jeroen Vreeken's avatar
Jeroen Vreeken committed
71
72
$(LIBDIR)/libblock.la_LDFLAGS += -lm -lcontroller -llog
$(LIBDIR)/libblock.la: libcontroller.la liblog.la
Jeroen Vreeken's avatar
Jeroen Vreeken committed
73
74
75
$(LIBDIR)/libblock.la: $(BLOCK_OBJS)
	$(LIB_LINK)

Jeroen Vreeken's avatar
Jeroen Vreeken committed
76
77
CTRL_BLOCKS += $(BLOCKS) $(BLOCKS_IL)
CTRL_BLOCK_LIBS += libblock.la
Jeroen Vreeken's avatar
Jeroen Vreeken committed
78
79

TARGETS += $(BLOCK_TARGETS)
Jeroen Vreeken's avatar
Jeroen Vreeken committed
80
CLEAN += $(BLOCK_TARGETS) $(BLOCK_OBJS) $(BLOCK_OBJS:.lo=.o)
Jeroen Vreeken's avatar
Jeroen Vreeken committed
81
SRCS += $(BLOCK_SRCS)
Jeroen Vreeken's avatar
Jeroen Vreeken committed
82
83

CTRL_TESTS += \
Jeroen Vreeken's avatar
Jeroen Vreeken committed
84
	$(DIR)/block_command_bool.test.ctrl \
Jeroen Vreeken's avatar
Jeroen Vreeken committed
85
	$(DIR)/block_gain.test.ctrl \
Jeroen Vreeken's avatar
Jeroen Vreeken committed
86
87
	$(DIR)/block_limit.test.ctrl \
	$(DIR)/block_matrix_2x2.test.ctrl \
Jeroen Vreeken's avatar
Jeroen Vreeken committed
88
	$(DIR)/block_not.test.ctrl \
89
	$(DIR)/block_pid_aw.test.ctrl \
Jeroen Vreeken's avatar
Jeroen Vreeken committed
90
	$(DIR)/block_rangecheck.test.ctrl \
Jeroen Vreeken's avatar
Jeroen Vreeken committed
91
	$(DIR)/block_setpoint_generator_1d.test.ctrl \
Jeroen Vreeken's avatar
Jeroen Vreeken committed
92
93
	$(DIR)/block_setpoint_generator_3d.test.ctrl \
	$(DIR)/block_servo_state.test.ctrl \
94
	$(DIR)/block_state_machine.test.ctrl \
Jeroen Vreeken's avatar
Jeroen Vreeken committed
95
	$(DIR)/block_quantize.test.ctrl
Jeroen Vreeken's avatar
Jeroen Vreeken committed
96