forked from freemint/freemint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRULES
125 lines (101 loc) · 3.83 KB
/
RULES
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#
# These are some standard rules common to all Makefiles.
#
include $(srcdir)/BINFILES
include $(srcdir)/SRCFILES
include $(srcdir)/EXTRAFILES
include $(srcdir)/MISCFILES
#
# mapping of CPU names to CFLAGS
#
MODEL_000 = -m68000
MODEL_020 = -m68020
MODEL_02060 = -m68020-60
MODEL_030 = -m68030
MODEL_040 = -m68040
MODEL_060 = -m68060
MODEL_v4e = -mcpu=5475
#
# mapping of TARGET names to CPU
#
CPU_deb = 02060
CPU_000 = 000
CPU_020 = 020
CPU_02060 = 02060
CPU_030 = 030
CPU_040 = 040
CPU_060 = 060
CPU_col = v4e
CPU_ara = 040
CPU_080 = 040
CPU_mil = 02060
CPU_hat = 000
CPU_hat030 = 030
CFLAGS_000 = $(MODEL_000) $(INCLUDES) $(DEFINITIONS) $(GENERAL) $(OPTS) $(WARN)
CFLAGS_020 = $(MODEL_020) $(INCLUDES) $(DEFINITIONS) $(GENERAL) $(OPTS) $(WARN)
CFLAGS_02060 = $(MODEL_02060) $(INCLUDES) $(DEFINITIONS) $(GENERAL) $(OPTS) $(WARN)
CFLAGS_030 = $(MODEL_030) $(INCLUDES) $(DEFINITIONS) $(GENERAL) $(OPTS) $(WARN)
CFLAGS_040 = $(MODEL_040) $(INCLUDES) $(DEFINITIONS) $(GENERAL) $(OPTS) $(WARN)
CFLAGS_060 = $(MODEL_060) $(INCLUDES) $(DEFINITIONS) $(GENERAL) $(OPTS) $(WARN)
CFLAGS_v4e = $(MODEL_v4e) $(INCLUDES) $(DEFINITIONS) $(GENERAL) $(OPTS) $(WARN)
all: all-recursive all-here
clean:: clean-recursive
rm -f *.o lib*.a *.tmp
rm -f core report nohup.out errlog
test "$(compile_all_dirs)" = "" || rm -f $(addsuffix /*.o,$(compile_all_dirs)) $(addsuffix /lib*.a,$(compile_all_dirs))
test "$(GENFILES)" = "" || rm -rf $(GENFILES)
bakclean:: bakclean-recursive
rm -f *~ *# *.BAK *.bak
rm -f *.orig *.rej
distclean:: distclean-recursive
rm -f *.o lib*.a *.tmp *~ *# *.orig *.rej *.BAK *.bak
rm -f core report nohup.out errlog
test "$(GENFILES)" = "" || rm -rf $(GENFILES)
test "$(SGENFILES)" = "" || rm -rf $(SGENFILES)
rm -rf .deps
strip: strip-recursive
install: install-recursive
uninstall: uninstall-recursive
DISTFILES = $(MISCFILES) $(SRCFILES)
distdir = $(top_builddir)/freemint-$(VERSION)/$(subdir)
distdir: $(DISTFILES) distdir-local
@for file in $(DISTFILES); do \
d=$(srcdir); \
test -d $$d/$$file \
|| test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2>/dev/null \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
done
list='$(SUBDIRS)'; for subdir in $$list; do \
test -d $(distdir)/$$subdir \
|| mkdir $(distdir)/$$subdir \
|| exit 1; \
chmod 777 $(distdir)/$$subdir; \
(cd $$subdir && $(MAKE) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
|| exit 1; \
done
distdir-local:
all-recursive clean-recursive bakclean-recursive distclean-recursive \
install-recursive uninstall-recursive dist-recursive strip-recursive::
@set fnord $(MAKEFLAGS); amf=$$2; \
list='$(SUBDIRS)'; for subdir in $$list; do \
target=`echo $@ | sed s/-recursive//`; \
echo "Making $$target in $$subdir"; \
(cd $$subdir && $(MAKE) -r $$target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
# use this when the first argument is a kernel target
define CC_TEMPLATE
.compile_$(1)/$(notdir $(basename $(2))).o: $(2)
@echo "$(CC) $(INCLUDES) $$(DEFINITIONS_$(1)) $$(MODEL_$$(CPU_$(1))) $(GENERAL) $(OPTS) $(WARN) $(CPPFLAGS) $$(CFLAGS-$(1)-$$(<F)) -c $$< -o $$@"
@$(CC) $(INCLUDES) $$(DEFINITIONS_$(1)) $$(MODEL_$$(CPU_$(1))) $(GENERAL) $(OPTS) $(WARN) $(CPPFLAGS) $$(CFLAGS-$(1)-$$(<F)) -Wp,-MD,.compile_$(1)/.deps/$(notdir $(2)).P -Wp,-MT,$$@ -c $$< -o $$@
-include .compile_$(1)/.deps/$(notdir $(2)).P
endef
# use this when the first argument is a cpu target
define CPU_TEMPLATE
.compile_$(1)/$(notdir $(basename $(2))).o: $(2)
@echo "$(CC) $(INCLUDES) $$(DEFINITIONS_$(1)) $$(MODEL_$(1)) $(GENERAL) $(OPTS) $(WARN) $(CPPFLAGS) -c $$< -o $$@"
$(CC) $(INCLUDES) $$(DEFINITIONS_$(1)) $$(MODEL_$(1)) $(GENERAL) $(OPTS) $(WARN) $(CPPFLAGS) -Wp,-MD,.compile_$(1)/.deps/$(notdir $(2)).P -Wp,-MT,$$@ -c $$< -o $$@
-include .compile_$(1)/.deps/$(notdir $(2)).P
endef