build.mk 1.67 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
25
26
27
28
29
30
	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 \
	pid \
	pid_aw \
	quadrature_decoder \
	quantize \
	random \
	rangecheck \
31
32
	setpoint_generator_1d \
	setpoint_generator_3d \
Jeroen Vreeken's avatar
Jeroen Vreeken committed
33
34
35
36
37
38
39
40
41
42
	servo_state \
	sine \
	state_machine \
	subtract \
	switch \
	trajectplayer \
	trigger \
	value \
	value_bool \
	value_uint32
Jeroen Vreeken's avatar
Jeroen Vreeken committed
43

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

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

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

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


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

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

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

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