File: Makefile

package info (click to toggle)
diskscan 0.20-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,656 kB
  • sloc: ansic: 11,136; python: 338; xml: 138; sh: 41; makefile: 34
file content (38 lines) | stat: -rw-r--r-- 977 bytes parent folder | download | duplicates (7)
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
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