-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (48 loc) · 1.24 KB
/
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
50
51
52
53
54
55
56
57
58
EXTPKGS=
SRCPKGS=machine network file block common logger
TESTPKGS=file
LIBPKGS=$(EXTPKGS) $(SRCPKGS)
LIBS=$(addprefix -l, $(LIBPKGS)) -pthread
SRCLIBS=$(addsuffix .a, $(addprefix lib, $(SRCPKGS)))
MAIN=main
all: libs main
test: libs utest runtest
clean: cleansrc cleantest
retest: cleantest libs utest runtest
libs:
@for pkg in $(SRCPKGS); do \
echo "checking $$pkg"; \
make -C src/$$pkg --no-print-directory PKGNAME=$$pkg; \
done
main:
@echo "checking $(MAIN)"
@make -C src/$(MAIN) --no-print-directory INCLIB="$(LIBS)" SRCLIBS="$(SRCLIBS)";
utest:
@for pkg in $(TESTPKGS); do \
echo "checking test $$pkg"; \
make -C test/$$pkg --no-print-directory INCLIB="$(LIBS)"; \
done
runtest:
@for pkg in $(TESTPKGS); do \
echo "run $$pkg"; \
make -C test/$$pkg --no-print-directory run; \
done
cleansrc:
@for pkg in $(SRCPKGS); do \
echo "clean $$pkg"; \
make -C src/$$pkg --no-print-directory clean; \
done
@echo "clean $(MAIN)";
@make -C src/$(MAIN) --no-print-directory clean;
@echo "removing $(SRCLIBS)"
@cd lib; rm -f $(SRCLIBS)
@echo "removing bin"
@rm -f bin/*
cleantest:
@for pkg in $(TESTPKGS); do \
echo "clean test $$pkg"; \
make -C test/$$pkg --no-print-directory clean; \
done
reset:
rm -rf block .Doopey
mkdir block