-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
109 lines (86 loc) · 1.99 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
105
106
107
108
109
#
# Makefile for cops
#
SHELL = /bin/sh
SUBDIRS =
srcdir = .
top_srcdir = .
subdir = .
installdir = /opt/GEM/cops
cpu = all
default: help
include $(srcdir)/COPSDEFS
include $(top_srcdir)/CONFIGVARS
include $(top_srcdir)/RULES
include $(top_srcdir)/PHONY
all-here: all-targets
# default overwrites
# default definitions
compile_all_dirs = .compile_*
GENFILES = $(compile_all_dirs)
help:
@echo '#'
@echo '# targets:'
@echo '# --------'
@echo '# - all'
@echo '# - $(copstargets)'
@echo '#'
@echo '# - install'
@echo '# - clean'
@echo '# - distclean'
@echo '# - bakclean'
@echo '# - strip'
@echo '# - help'
@echo '#'
@echo '# example for a ColdFire binary: -> make col'
@echo '#'
@echo '# To install single CPU binary: ->'
@echo '# make install cpu=<CPU> installdir=<DIR>'
@echo '#'
strip:
@set fnord $(MAKEFLAGS); amf=$$2; \
for i in $(copstargets); do \
(set -x; \
($(STRIP) .compile_$$i/*.app) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac); \
done && test -z "$$fail"
all-targets:
@set fnord $(MAKEFLAGS); amf=$$2; \
for i in $(copstargets); do \
echo "Making $$i"; \
($(MAKE) $$i) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
install: $(cpu)
$(MKDIR) -p $(installdir)
ifeq ($(cpu), all)
@set -x; \
for i in $(copstargets); do \
$(CP) .compile_$$i/cops.app $(installdir)/cops$$i.app; \
chmod 755 $(installdir)/cops$$i.app; \
$(STRIP) $(installdir)/cops$$i.app; \
done
else
$(CP) .compile_$(cpu)/cops.app $(installdir)/cops.app
chmod 755 $(installdir)/cops.app
$(STRIP) $(installdir)/cops.app
endif
$(CP) $(srcdir)/copsicn.rsc $(installdir)
$(copstargets):
$(MAKE) buildcops cops=$@
#
# multi target stuff
#
ifneq ($(cops),)
compile_dir = .compile_$(cops)
copstarget = _stmp_$(cops)
realtarget = $(copstarget)
$(copstarget): $(compile_dir)
cd $(compile_dir); $(MAKE) all
$(compile_dir): Makefile.objs
$(MKDIR) -p $@
$(CP) $< $@/Makefile
else
realtarget =
endif
buildcops: $(realtarget)