build.mk 1.28 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
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
BLOCKS := \
	add \
	bridge_pwm \
	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 \
30
31
	setpoint_generator_1d \
	setpoint_generator_3d \
Jeroen Vreeken's avatar
Jeroen Vreeken committed
32
33
34
35
36
37
38
39
40
41
	servo_state \
	sine \
	state_machine \
	subtract \
	switch \
	trajectplayer \
	trigger \
	value \
	value_bool \
	value_uint32
Jeroen Vreeken's avatar
Jeroen Vreeken committed
42

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

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

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

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


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

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

TARGETS += $(BLOCK_TARGETS)
CLEAN += $(BLOCK_TARGETS) $(BLOCK_OBJS)
SRCS += $(BLOCK_SRCS)