-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
163 lines (136 loc) · 4.36 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
#
# Makefile for TosWin 2
#
SHELL = /bin/sh
SUBDIRS = tw-call
srcdir = .
top_srcdir = .
subdir = .
installdir = /opt/GEM/toswin2
cpu = all
default: help
include $(srcdir)/TOSWIN2DEFS
include $(top_srcdir)/CONFIGVARS
include $(top_srcdir)/RULES
include $(top_srcdir)/PHONY
all-here: all-targets doc/toswin2.hyp doc/en/toswin2.hyp doc/fr/toswin2.hyp
# default overwrites
# default definitions
compile_all_dirs = .compile_*
GENFILES = $(compile_all_dirs)
help:
@echo '#'
@echo '# targets:'
@echo '# --------'
@echo '# - all'
@echo '# - $(toswin2targets)'
@echo '#'
@echo '# - install'
@echo '# - strip'
@echo '# - clean'
@echo '# - bakclean'
@echo '# - distclean'
@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 $(toswin2targets); 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 $(toswin2targets); do \
echo "Making $$i"; \
($(MAKE) $$i) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
doc/toswin2.hyp: doc/toswin2.stg
@if test "$(HCP)" != ""; then hcp="$(HCP)"; else hcp=hcp; fi; \
if test "$$hcp" != "" && $$hcp --version >/dev/null 2>&1; then \
$$hcp -o $@ $<; \
else \
echo "HCP not found, help file not compiled" >&2; \
fi
doc/en/toswin2.hyp: doc/en/toswin2.stg
@if test "$(HCP)" != ""; then hcp="$(HCP)"; else hcp=hcp; fi; \
if test "$$hcp" != "" && $$hcp --version >/dev/null 2>&1; then \
$$hcp -o $@ $<; \
else \
echo "HCP not found, help file not compiled" >&2; \
fi
doc/fr/toswin2.hyp: doc/fr/toswin2.stg
@if test "$(HCP)" != ""; then hcp="$(HCP)"; else hcp=hcp; fi; \
if test "$$hcp" != "" && $$hcp --version >/dev/null 2>&1; then \
$$hcp -o $@ $<; \
else \
echo "HCP not found, help file not compiled" >&2; \
fi
install: $(cpu) doc/toswin2.hyp doc/en/toswin2.hyp doc/fr/toswin2.hyp
$(MKDIR) -p $(installdir)
ifeq ($(cpu), all)
@set -x; \
for i in $(toswin2targets); do \
$(CP) .compile_$$i/toswin2.app $(installdir)/tw2$$i.app; \
$(CP) tw-call/.compile_$$i/tw-call.app $(installdir)/twc$$i.app; \
chmod 755 $(installdir)/tw2$$i.app $(installdir)/twc$$i.app; \
$(STRIP) $(installdir)/tw2$$i.app $(installdir)/twc$$i.app; \
done
else
$(CP) .compile_$(cpu)/toswin2.app $(installdir)/toswin2.app
$(CP) tw-call/.compile_$(cpu)/tw-call.app $(installdir)/tw-call.app
chmod 755 $(installdir)/toswin2.app $(installdir)/tw-call.app
$(STRIP) $(installdir)/toswin2.app $(installdir)/tw-call.app
endif
$(MKDIR) -p $(installdir)/doc/de
$(MKDIR) -p $(installdir)/doc/en
$(MKDIR) -p $(installdir)/doc/fr
-$(CP) $(srcdir)/doc/toswin2.hyp $(installdir)/doc/de
-$(CP) $(srcdir)/doc/toswin2.ref $(installdir)/doc/de
-$(CP) $(srcdir)/doc/en/toswin2.hyp $(installdir)/doc/en
-$(CP) $(srcdir)/doc/en/toswin2.ref $(installdir)/doc/en
-$(CP) $(srcdir)/doc/fr/toswin2.hyp $(installdir)/doc/fr
-$(CP) $(srcdir)/doc/fr/toswin2.ref $(installdir)/doc/fr
$(CP) $(srcdir)/english/toswin2.rsc $(installdir)
$(CP) -r $(srcdir)/screenshots $(installdir)
$(CP) $(srcdir)/BUGS $(installdir)
$(CP) $(srcdir)/FAQ $(installdir)
$(CP) $(srcdir)/NEWS $(installdir)
$(MKDIR) -p $(installdir)/de
$(CP) $(srcdir)/toswin2.rsc $(installdir)/de
$(CP) $(srcdir)/allcolors.sh $(installdir)
$(CP) $(srcdir)/twterm.src $(installdir)
$(CP) $(srcdir)/README.terminfo $(installdir)
$(CP) $(srcdir)/vttest.txt $(installdir)
$(toswin2targets):
$(MAKE) buildtoswin2 toswin2=$@
#
# multi target stuff
#
ifneq ($(toswin2),)
compile_dir = .compile_$(toswin2)
toswin2target = _stmp_$(toswin2)
realtarget = $(toswin2target)
$(toswin2target): $(compile_dir)
@set fnord $(MAKEFLAGS); amf=$$2; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$toswin2 in $$subdir"; \
(cd $$subdir && $(MAKE) -r $$toswin2) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
cd $(compile_dir); $(MAKE) all
$(compile_dir): Makefile.objs
$(MKDIR) -p $@
$(CP) $< $@/Makefile
else
realtarget =
endif
buildtoswin2: $(realtarget)
clean::
$(RM) doc/toswin2.hyp doc/toswin2.ref doc/en/toswin2.hyp doc/en/toswin2.ref doc/fr/toswin2.hyp doc/fr/toswin2.ref