-
Notifications
You must be signed in to change notification settings - Fork 53
/
Makefile
38 lines (28 loc) · 995 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
EXECUTABLE = demo
SHARED_LIB = libprogressbar.so
STATIC_LIB = libprogressbar.a
SRC=lib
INCLUDE=include/progressbar
TEST=test
CFLAGS += -std=c99 -I$(INCLUDE) -Wimplicit-function-declaration -Wall -Wextra -pedantic
CFLAGS_DEBUG = -g -O0
LDLIBS = -lncurses
all: $(EXECUTABLE) $(SHARED_LIB) $(STATIC_LIB)
debug: CFLAGS += $(CFLAGS_DEBUG)
debug: $(EXECUTABLE)
doc: $(INCLUDE)/progressbar.h $(INCLUDE)/statusbar.h
mkdir -p doc
doxygen
$(EXECUTABLE): $(EXECUTABLE).o progressbar.o statusbar.o
libprogressbar.so: $(INCLUDE)/progressbar.h $(SRC)/progressbar.c
$(CC) -fPIC -shared -o $@ -c $(CFLAGS) $(CPPFLAGS) $(SRC)/progressbar.c
libprogressbar.a: libprogressbar.a(progressbar.o)
%.o: $(SRC)/%.c $(INCLUDE)/%.h
$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
demo.o: CFLAGS += -std=gnu99 # Demo uses usleep which requires POSIX or BSD source
demo.o: $(TEST)/demo.c
$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o demo.o
.PHONY: clean
clean:
rm -f *.o $(EXECUTABLE) $(SHARED_LIB) $(STATIC_LIB)
rm -rf doc