forked from tysonanderson/infiniwall
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
36 lines (28 loc) · 978 Bytes
/
Makefile
1
2
3
4
5
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
.PHONY: clean
BINARIES = anaerobic_tracker cat_shm cli_incline cli_log cli_speed heartrate \
hr_tracker kiosk_sim logger mkshm scripted_session timestamp \
ct5k_w1 grindhouse
BINDIR = ./bin/
SOURCEDIR = ./src/
LIBSHMDIR = $(SOURCEDIR)libshm_vars/
LIBSHM = $(LIBSHMDIR)libshm_vars.a
TARGET_LIST = $(addprefix $(BINDIR), $(BINARIES))
INCLUDES = -I./src -I./src/libshm_vars
CC = g++
LDFLAGS = -L./src/libshm_vars -lshm_vars -lpthread -lrt
all: $(TARGET_LIST)
$(BINDIR)%: $(SOURCEDIR)%.cpp $(LIBSHM)
$(CC) $< $(INCLUDES) $(LDFLAGS) -o $@
$(LIBSHM): $(LIBSHMDIR)Shm.h $(LIBSHMDIR)Shm_vars.h \
$(LIBSHMDIR)Shm_vars.cpp $(LIBSHMDIR)Command.cpp
cd $(LIBSHMDIR); \
g++ -c Command.cpp; \
g++ -c Shm_vars.cpp; \
ar -cq libshm_vars.a Shm_vars.o Command.o; \
rm -f Shm_vars.o Command.o
clean:
for target in $(BINARIES); do \
rm -f $(BINDIR)/$$target; \
done
rm -f $(LIBSHMDIR)Shm_vars.o $(LIBSHMDIR)Command.o
rm -f $(LIBSHM)