-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
49 lines (32 loc) · 768 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
39
40
41
42
43
44
45
46
47
48
49
CC = /usr/bin/gcc
CFLAGS = -std=gnu11 -Werror -Wall
LIBS = -pthread -lrt
SDIR=src
IDIR=include
BDIR=bin
ODIR=obj
_OBJ = main.o daemon.o worker.o util.o
OBJ = $(patsubst %,$(ODIR)/%,$(_OBJ))
_DEPS = daemon.h worker.h util.h
DEPS = $(patsubst %,$(IDIR)%,$(_DEPS))
$(ODIR)/util.o: $(SDIR)/util.c
$(CC) -c -o $@ $< $(CFLAGS)
$(ODIR)/daemon.o: $(SDIR)/daemon.c
$(CC) -c -o $@ $< $(CFLAGS)
$(ODIR)/worker.o: $(SDIR)/worker.c
$(CC) -c -o $@ $< $(CFLAGS)
$(ODIR)/main.o: $(SDIR)/main.c
$(CC) -c -o $@ $< $(CFLAGS)
barbd: $(OBJ)
$(CC) -o $(BDIR)/$@ $^ $(CFLAGS) $(LIBS)
.PHONY: all clean execute doc-regen clean-doc
all: barbd
clean:
rm -f $(ODIR)/*.o $(BDIR)/*
execute:
$(BDIR)/barbd
doc-regen:
rm -rf doc/*
doxygen
clean-doc:
rm -rf doc/*