build.mk 1.37 KB
Newer Older
1

Jeroen Vreeken's avatar
Jeroen Vreeken committed
2
3
ifdef BUILD_TCP

4
5
COMMAND_TARGETS += $(LIBDIR)/libcommand.la

6
7
COMMAND_TARGETS += $(DIR)/command_list $(DIR)/command_send

Jeroen Vreeken's avatar
Jeroen Vreeken committed
8
ifdef BUILD_LINUX_JOYSTICK
9
10
COMMAND_TARGETS += $(DIR)/command_joystick
endif
11
12
13
14
15
16


ARCHSRCS := $(DIR)/command.c $(DIR)/command_tcp.c
ARCHOBJS := $(ARCHSRCS:.c=.lo)


17
$(ARCHOBJS): CFLAGS += -Wall -O3 -fPIC
Jeroen Vreeken's avatar
Jeroen Vreeken committed
18
$(LIBDIR)/libcommand.la: libutils.la liblog.la
19
$(LIBDIR)/libcommand.la_LDFLAGS += -lutils -lm -llog
20
21
22
23
24
25
$(LIBDIR)/libcommand.la: $(ARCHOBJS)
	$(LIB_LINK)

COMMAND_LIST_SRCS := $(DIR)/command_list.c
COMMAND_LIST_OBJS := $(COMMAND_LIST_SRCS:.c=.o)

Jeroen Vreeken's avatar
Jeroen Vreeken committed
26
$(DIR)/command_list: libcommand.la
27
$(DIR)/command_list_LDFLAGS += -lcommand
28
29
$(DIR)/command_list: $(COMMAND_LIST_OBJS)

30
31
32
33
34
35
36
COMMAND_SEND_SRCS := $(DIR)/command_send.c
COMMAND_SEND_OBJS := $(COMMAND_SEND_SRCS:.c=.o)

$(DIR)/command_send: libcommand.la
$(DIR)/command_send_LDFLAGS += -lcommand
$(DIR)/command_send: $(COMMAND_SEND_OBJS)

37
38
39
40
41
42
43
44
COMMAND_JOYSTICK_SRCS := $(DIR)/command_joystick.c
COMMAND_JOYSTICK_OBJS := $(COMMAND_JOYSTICK_SRCS:.c=.o)

$(DIR)/command_joystick: libcommand.la
$(DIR)/command_joystick_LDFLAGS += -lcommand
$(DIR)/command_joystick: $(COMMAND_JOYSTICK_OBJS)

SRCS += $(ARCHSRCS) $(COMMAND_LIST_SRCS) $(COMMAND_SEND_SRCS) $(COMMAND_JOYSTICK_SRCS)
45
TARGETS += $(COMMAND_TARGETS)
46
47
48
CLEAN += $(COMMAND_TARGETS) $(ARCHOBJS) \
	$(COMMAND_LIST_OBJS) \
	$(COMMAND_SEND_OBJS) \
49
	$(COMMAND_JOYSTICK_OBJS) \
50
	$(LIBDIR)/libcommand.a
Jeroen Vreeken's avatar
Jeroen Vreeken committed
51
52

endif