-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
61 lines (52 loc) · 1.34 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
59
60
61
REFPKGS = cmd
SRCPKGS = cir util
LIBPKGS = $(REFPKGS) $(SRCPKGS)
MAIN = main
LIBS = $(addprefix -l, $(LIBPKGS))
SRCLIBS = $(addsuffix .a, $(addprefix lib, $(SRCPKGS)))
EXEC = cirTest
all: libs main
libs:
@for pkg in $(SRCPKGS); \
do \
echo "Checking $$pkg..."; \
cd src/$$pkg; make -f make.$$pkg --no-print-directory PKGNAME=$$pkg; \
cd ../..; \
done
main:
@echo "Checking $(MAIN)..."
@cd src/$(MAIN); \
make -f make.$(MAIN) --no-print-directory INCLIB="$(LIBS)" EXEC=$(EXEC);
@ln -fs bin/$(EXEC) .
# @strip bin/$(EXEC)
clean:
@for pkg in $(SRCPKGS); \
do \
echo "Cleaning $$pkg..."; \
cd src/$$pkg; make -f make.$$pkg --no-print-directory PKGNAME=$$pkg clean; \
cd ../..; \
done
@echo "Cleaning $(MAIN)..."
@cd src/$(MAIN); make -f make.$(MAIN) --no-print-directory clean
@echo "Removing $(SRCLIBS)..."
@cd lib; rm -f $(SRCLIBS)
@echo "Removing $(EXEC)..."
@rm -f bin/$(EXEC)
cleanall: clean
@echo "Removing bin/*..."
@rm -f bin/*
ctags:
@rm -f src/tags
@for pkg in $(SRCPKGS); \
do \
echo "Tagging $$pkg..."; \
cd src; ctags -a $$pkg/*.cpp $$pkg/*.h; cd ..; \
done
@echo "Tagging $(MAIN)..."
@cd src; ctags -a $(MAIN)/*.cpp $(MAIN)/*.h
linux mac:
@for pkg in $(REFPKGS); \
do \
cd lib; ln -sf lib$$pkg-$@.a lib$$pkg.a; cd ../..; \
done
@cd ref; ln -sf $(EXEC)-$@ $(EXEC)-ref;