-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
38 lines (28 loc) · 834 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
37
38
CC?=
PREFIX?=/usr/local
BINDIR=$(PREFIX)/bin
CPPFLAGS=-I./libpidutil -I$(PREFIX)/include
CFLAGS=-Wall -Werror -Wextra -g -std=c17 -O2 -pipe -funroll-loops -ffast-math -fno-strict-aliasing
CFLAGS+=$(CPPFLAGS)
LDFLAGS=-L$(PREFIX)/lib -L./libpidutil
LDLIBS=-lpidutil -lpthread
TARGET=fsipd
SUBDIRS = libpidutil
PROGS = fsipd logfile_test
OBJ = logfile.o fsipd.o
.PHONY: $(SUBDIRS) get-deps
all: get-deps $(SUBDIRS) fsipd
fsipd: $(OBJ)
$(CC) $(LDFLAGS) $(OBJ) $(LDLIBS) -o fsipd
get-deps:
git submodule update --init
$(SUBDIRS):
$(MAKE) -C $@ all
test: logfile.h logfile.c logfile_test.c
$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) logfile.c logfile_test.c -o logfile_test
install:
install -D $(TARGET) $(BINDIR)/$(TARGET)
clean:
rm -f *.BAK *.log *.o *.a a.out core temp.* $(PROGS)
rm -fr *.dSYM
$(MAKE) -C libpidutil clean