build.mk 1.19 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
30
31
32
33
34
35
36
37
38
39
40
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 \
	setpoint_generator \
	servo_state \
	sine \
	state_machine \
	subtract \
	switch \
	trajectplayer \
	trigger \
	value \
	value_bool \
	value_uint32
Jeroen Vreeken's avatar
Jeroen Vreeken committed
41

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

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

Jeroen Vreeken's avatar
Jeroen Vreeken committed
56
57
58
59
BLOCK_SRCS := \
	$(addsuffix .c,$(addprefix $(DIR)/block_,$(BLOCKS))) \
	$(addsuffix .il,$(addprefix $(DIR)/block_,$(BLOCKS_IL)))

Jeroen Vreeken's avatar
Jeroen Vreeken committed
60
61
62
63
BLOCK_OBJSC := $(BLOCK_SRCS:.c=.lo)
BLOCK_OBJS := $(BLOCK_OBJSC:.il=.il2c.lo)


64
$(BLOCK_OBJS): CFLAGS += -O3 -Wall
Jeroen Vreeken's avatar
Jeroen Vreeken committed
65
66
$(LIBDIR)/libblock.la_LDFLAGS += -lm -lcontroller -llog
$(LIBDIR)/libblock.la: libcontroller.la liblog.la
Jeroen Vreeken's avatar
Jeroen Vreeken committed
67
68
69
$(LIBDIR)/libblock.la: $(BLOCK_OBJS)
	$(LIB_LINK)

Jeroen Vreeken's avatar
Jeroen Vreeken committed
70
71
CTRL_BLOCKS += $(BLOCKS) $(BLOCKS_IL)
CTRL_BLOCK_LIBS += libblock.la
Jeroen Vreeken's avatar
Jeroen Vreeken committed
72
73
74
75

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