forked from freemint/mintlib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
236 lines (197 loc) · 7.23 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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
# Makefile -- MiNTLib.
# Copyright (C) 1999-2001 Guido Flohr <[email protected]>
# $Id$
#
# This file is part of the MiNTLib project, and may only be used
# modified and distributed under the terms of the MiNTLib project
# license, COPYMINT. By continuing to use, modify, or distribute
# this file you indicate that you have read the license and
# understand and accept it fully.
MAKEFLAGS = -r
SHELL = /bin/sh
srcdir = .
top_srcdir = .
include $(top_srcdir)/configvars
-include /etc/sparemint/timezone
ifdef TIMEZONE
LOCALTIME = $(TIMEZONE)
POSIXRULES = $(TIMEZONE)
endif
SUBDIRS = include syscall startup argp conf crypt dirent gmp login mintlib \
misc multibyte posix pwdgrp shadow signal socket stdiio stdio stdlib \
string sysvipc termios time unix lib tz sunrpc
DIST_SUBDIRS = argp conf crypt dirent gmp include lib \
login mintlib misc multibyte posix pwdgrp shadow signal socket startup \
stdiio stdio stdlib string sunrpc syscall sysvipc termios time tz unix
TEST_SUBDIRS = argp crypt dirent login mintlib misc posix pwdgrp shadow signal \
socket startup stdiio stdio stdlib string time tz unix
ifeq ($(WITH_PROFILE_LIB), yes)
SUBDIRS += lib_p
DIST_SUBDIRS += lib_p
endif
ifeq ($(WITH_DEBUG_LIB), yes)
SUBDIRS += lib_g
DIST_SUBDIRS += lib_g
endif
ifeq ($(WITH_020_LIB), yes)
SUBDIRS += lib020
DIST_SUBDIRS += lib020
endif
ifeq ($(WITH_V4E_LIB), yes)
SUBDIRS += libv4e
DIST_SUBDIRS += libv4e
endif
include $(srcdir)/BINFILES
include $(srcdir)/SRCFILES
include $(srcdir)/MISCFILES
include $(srcdir)/EXTRAFILES
default: all
include phony
all: all-here all-recursive
all-here:
install: all-here install-recursive zoneswarning
uninstall: uninstall-recursive
install-lib: all install-lib-recursive
install-include: all install-include-recursive
install-man: all install-man-recursive
clean: clean-recursive
rm -rf .deps includepath CFILES
bakclean: bakclean-recursive
checkclean: checkclean-recursive
DISTFILES = $(MISCFILES) $(SRCFILES)
BINDISTFILES = $(MISCFILES) $(BINFILES)
distdir = mintlib-$(VERSION)
bindistdir = $(distdir)-bin
topdistdir = $(distdir)
topbindistdir = $(topdistdir)-bin
dist-check:
@echo "WARNING: This will take VERY long and will consume"
@echo "VERY much diskspace!!!"
@$(MAKE) dist && tar xzf $(distdir).tar.gz && cd $(distdir) \
&& $(MAKE) && $(MAKE) bin-dist \
&& echo "##################################################" \
&& echo "# $(distdir) is ready for distribution." \
&& echo "##################################################"
@rm -f $(distdir)
dist: $(top_srcdir)/CFILES $(top_srcdir)/include/features.h \
$(top_srcdir)/include/linker.h distdir
-chmod -R a+r $(distdir)
touch $(distdir)/include/features.h $(distdir)/include/linker.h
GZIP=$(GZIP) $(TAR) chzf $(distdir).tar.gz $(distdir)
-rm -rf $(distdir)
distdir: $(DISTFILES)
@if sed 15q $(srcdir)/ChangeLog | fgrep -e "$(VERSION)" > /dev/null; then :; else \
echo "ChangeLog not updated; not releasing" 1>&2; \
exit 1; \
fi
-rm -rf $(distdir)
mkdir $(distdir)
-chmod 777 $(distdir)
@for file in $(DISTFILES); do \
d=$(srcdir); \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p -r $$d/$$file $(distdir)/$$file; \
done
for subdir in $(DIST_SUBDIRS); 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
bin-dist: bindistdir
-chmod -R a+r $(bindistdir)
GZIP=$(GZIP) $(TAR) chzf $(bindistdir).tar.gz $(bindistdir)
-rm -rf $(bindistdir)
bindistdir: $(BINDISTFILES)
@if sed 15q $(srcdir)/ChangeLog | fgrep -e "$(VERSION)" > /dev/null; then :; else \
echo "ChangeLog not updated; not releasing" 1>&2; \
exit 1; \
fi
-rm -rf $(bindistdir)
mkdir $(bindistdir)
-chmod 777 $(bindistdir)
@for file in $(BINDISTFILES); do \
d=$(srcdir); \
test -f $(bindistdir)/$$file \
|| ln $$d/$$file $(bindistdir)/$$file 2> /dev/null \
|| cp -p -r $$d/$$file $(bindistdir)/$$file; \
done
for subdir in $(DIST_SUBDIRS); do \
test "$$subdir" = "src" && continue; \
(cd $$subdir && $(MAKE) top_distdir=../$(bindistdir) binbasedir=../$(bindistdir) bindistdir) \
|| exit 1; \
done
all-recursive clean-recursive bakclean-recursive \
install-recursive uninstall-recursive install-lib-recursive \
install-include-recursive install-man-recursive uninstall-lib-recursive \
uninstall-include-recursive uninstall-man-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) $$target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
dist-recursive bindist-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
target=`echo $@ | sed s/-recursive//`; \
echo "Making $$target in $$subdir"; \
(cd $$subdir && $(MAKE) $$target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
check-recursive checkclean-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
list='$(TEST_SUBDIRS)'; for subdir in $$list; do \
target=`echo $@ | sed s/-recursive//`; \
echo "Making $$target in $$subdir"; \
(cd $$subdir && $(MAKE) $$target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
help:
@echo "This Makefile (and most of the Makefiles in the subdirectories)"
@echo "supports the following main targets:"
@echo
@echo " help show this help page (toplevel Makefile only)"
@echo " all build everyting (default)"
@echo " install install everything"
@echo " uninstall uninstall all files"
@echo " zonenames list possible values for time zone"
@echo " check build and run tests"
@echo
@echo "The following targets are intended for use by the"
@echo "maintainer:"
@echo
@echo " dist make a source distribution (toplevel Makefile"
@echo " only)"
@echo " bin-dist make a binary distribution (toplevel Makefile"
@echo " only)"
@echo
@echo "Please read the file INSTALL before running make. Edit"
@echo "the file configvars so that it matches the needs of "
@echo "your site."
zonenames:
cd $(top_srcdir)/tz && $(MAKE) zonenames
zoneswarning:
@if test $(LOCALTIME) = Factory; then \
echo "WARNING: Installed tz database with localtime set to" ;\
echo "dummy time zone \`Factory'. Run \`zic -l' with the" ;\
echo "correct timezone later or re-install after editing" ;\
echo "the \`LOCALTIME' variable in \`$(top_srcdir)/configvars." ;\
fi
@if test $(POSIXRULES) = America/New_York; then \
echo "WARNING: Installed tz database with posixrules set to" ;\
echo "dummy time zone \`Factory'. Run \`zic -p' with the" ;\
echo "correct timezone later or re-install after editing" ;\
echo "the \`POSIXRULES' variable in \`$(top_srcdir)/configvars." ;\
fi
check: check-recursive
00PatchLevel: 00PatchLevel.in configvars
rm -f $@
sed 's,@VERSION@,$(VERSION),g' [email protected] >$@
mintlib.spec: mintlib.spec.in configvars
rm -f $@
sed 's,@VERSION@,$(VERSION),g' [email protected] >$@