-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
106 lines (90 loc) · 2.5 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#############################################################################
# File [ Makefile ]
# Author [ littleshamoo ]
# Synopsis [ top makefile for the whole project, generated by script ]
# Date [ 2010/10/07 created ]
#############################################################################
include common.mk
include info.mk
# targets
OWNINS = $(addprefix install_,$(OWNPKGS))
OWNCLN = $(addprefix clean_,$(OWNPKGS))
OWNUNINS = $(addprefix uninstall_,$(OWNPKGS))
.PHONY: all install uninstall tags clean distclean
all : install
@echo -n
install : $(OWNINS)
@echo -n
uninstall : $(OWNUNINS)
@echo -n
tags :
ctags -R .
clean : $(OWNCLN)
@echo -n
rm -rf ./pat/*.pat
rm -rf ./pat/*.stil
rm -rf ./pat/*.wgl
rm -rf ./rpt/*.rpt
distclean :
@echo " RM $(LIBDIR)"
@rm -Rf $(LIBDIR)
@echo " RM $(INCDIR)"
@rm -Rf $(INCDIR)
@echo " RM $(BINDIR)"
@rm -Rf $(BINDIR)
@for pkg in $(OWNPKGS); do \
if [ ! -d $(PKGDIR)/$$pkg ]; then \
echo "!! Warning: package \`$$pkg' not found and ignored"; \
continue; \
fi; \
cd $(PKGDIR)/$$pkg; \
echo " CLN $$pkg"; \
rm -Rf $(LIBDIR); \
rm -Rf $(BINDIR); \
cd ../..; \
done
install_% :
@if [ ! -d $(INCDIR) ]; then \
mkdir $(INCDIR); \
fi
@if [ ! -d $(LIBDIR)/$(OPTDIR) ]; then \
mkdir -p $(LIBDIR)/$(OPTDIR); \
fi
@if [ ! -d $(LIBDIR)/$(DBGDIR) ]; then \
mkdir -p $(LIBDIR)/$(DBGDIR); \
fi
@if [ ! -d $(BINDIR)/$(OPTDIR) ]; then \
mkdir -p $(BINDIR)/$(OPTDIR); \
fi
@if [ ! -d $(BINDIR)/$(DBGDIR) ]; then \
mkdir -p $(BINDIR)/$(DBGDIR); \
fi
@pkg=$(filter $(subst install_,, $@), $(OWNPKGS)); \
if [ ! -d $(PKGDIR)/$$pkg ]; then \
echo "!! Warning: package \`$$pkg' not found and is ignored"; \
elif [ "$$pkg" = "" ]; then \
echo "!! Warning: package empty"; \
else \
cd $(PKGDIR)/$$pkg; \
make install --no-print-directory MODE="$(MODE)"; \
fi
uninstall_% :
@pkg=$(filter $(subst uninstall_,, $@), $(OWNPKGS)); \
if [ ! -d $(PKGDIR)/$$pkg ]; then \
echo "!! Warning: package \`$$pkg' not found and is ignored"; \
elif [ "$$pkg" = "" ]; then \
echo "!! Warning: package empty"; \
else \
cd $(PKGDIR)/$$pkg; \
make uninstall --no-print-directory MODE="$(MODE)"; \
fi
clean_% :
@pkg=$(filter $(subst clean_,, $@), $(OWNPKGS)); \
if [ ! -d $(PKGDIR)/$$pkg ]; then \
echo "!! Warning: package \`$$pkg' not found and is ignored"; \
elif [ "$$pkg" = "" ]; then \
echo "!! Warning: package empty"; \
else \
cd $(PKGDIR)/$$pkg; \
make clean --no-print-directory MODE="$(MODE)"; \
fi