-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (28 loc) · 836 Bytes
/
Makefile
File metadata and controls
40 lines (28 loc) · 836 Bytes
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
37
38
39
40
ifeq ($(shell uname -s), Darwin)
FTDI = $(shell brew --prefix libftdi || echo /opt/local)/include/libftdi1
else
FTDI = /usr/include/libftdi1
endif
IDIR = inc
ODIR = obj
CDIR = src
BDIR = bin
CFLAGS = -Wall -Wextra -Werror -std=gnu99 -O3 -fPIC -I $(FTDI) -I $(IDIR)
_INC = clock.h timespec.h utils.h libentstream.h entstream.h
INC = $(patsubst %,$(IDIR)/%,$(_INC))
_OBJ = clock.o timespec.o utils.o libentstream.o entstream.o
OBJ = $(patsubst %,$(ODIR)/%,$(_OBJ))
all: dirs entstream
entstream: $(OBJ)
$(CC) $(CFLAGS) -o $(BDIR)/$@ $^ -lftdi1 -lzmq -lczmq -lpopt -lm -L.
$(ODIR)/%.o: $(CDIR)/%.c $(INC)
$(CC) -c -o $@ $< $(CFLAGS)
.PHONY: dirs clean install uninstall
dirs:
@mkdir -p ${ODIR} ${BDIR}
clean:
@rm -rf ${ODIR} ${BDIR}
install:
@cp ${BDIR}/entstream /usr/local/bin/
uninstall:
@rm /usr/local/bin/entstream