-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
237 lines (205 loc) · 6.73 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
236
237
#
# top-level Makefile for m68k booters
#
# Copyright (c) 1997 by Roman Hodek <[email protected]>
#
# This file is subject to the terms and conditions of the GNU General Public
# License. See the file "COPYING" in the main directory of this archive
# for more details.
#
# $Id: Makefile,v 1.20 2004-08-15 11:47:04 geert Exp $
#
# $Log: Makefile,v $
# Revision 1.20 2004-08-15 11:47:04 geert
# - updates header #include's for compiling with kernel includes 2.2.25
# - updates Makefile to compile with new cross compiler
# - removes superfluous declaration of sync()
# (from Petr Stehlik)
#
# Revision 1.19 1998/04/09 08:10:53 rnhodek
# check-modified now really lists only modified files, not all files
# that aren't up to date.
#
# Revision 1.18 1998/04/06 01:40:50 dorchain
# make loader linux-elf.
# made amiga bootblock working again
# compiled, but not tested bootstrap
# loader breaks with MapOffset problem. Stack overflow?
#
# Revision 1.17 1998/03/16 11:06:35 rnhodek
# *** empty log message ***
#
# Revision 1.16 1998/03/16 10:49:34 rnhodek
# 1.15 has been done by Andreas Schwab, I just commited the version
# under the wrong login...
#
# Revision 1.15 1998/03/16 10:33:39 schwab
# Pass empty prefix by default.
#
# Revision 1.14 1998/03/04 09:08:47 rnhodek
# Remove some more files on 'distclean'.
#
# Revision 1.13 1998/03/03 15:11:08 rnhodek
# Remove TAGS only on distclean, not clean.
#
# Revision 1.12 1998/02/26 11:37:09 rnhodek
# Added commands for doc subdir.
#
# Revision 1.11 1998/02/23 10:12:48 rnhodek
# Add ($MACH) to do_install invocation, can be set from command line if
# no /proc/hardware available.
# Fix TAGS target.
#
# Revision 1.10 1998/02/19 22:00:31 rnhodek
# Fix/rewrite check-modified and check-needed
#
# Revision 1.9 1998/02/19 21:52:13 rnhodek
# Added release, check-modified, and check-need targets.
#
# Revision 1.8 1998/02/19 21:27:06 rnhodek
# Add install and binary targets
#
# Revision 1.7 1997/08/10 19:49:46 rnhodek
# Hardwire $(CC) to m68k-linux-gcc, no sense in a cross-lilo :-)
# >& /dev/null didn't work
#
# Revision 1.6 1997/07/17 14:16:58 geert
# Use >& instead of >... 2>&1
#
# Revision 1.6 1997/07/17 14:09:34 rnhodek
# Use >& instead of >... 2>&1
#
# Revision 1.5 1997/07/16 13:39:36 rnhodek
# KERNEL_HEADERS var to find kernel headers
#
# Revision 1.4 1997/07/16 13:29:09 rnhodek
# Add targets to make .i and .s files; remove those files on make clean
#
# Revision 1.3 1997/07/16 10:32:48 rnhodek
# Implemented dep target; more minor Makefile changes
#
# Revision 1.2 1997/07/16 09:29:08 rnhodek
# Reorganized Makefiles so that all objects are built in
# {bootstrap,lilo}/{amiga,atari}, not in common anymore. Define IN_BOOTSTRAP or
# IN_LILO so that common sources can distinguish between the environments.
# Other minor Makefile changes.
#
# Revision 1.1.1.1 1997/07/15 09:45:37 rnhodek
# Import sources into CVS
#
#
# possible options:
# AOUT_KERNEL:
# Include support for a.out kernels (may go away in future!)
# BOOTINFO_COMPAT_1_0:
# Include support for booting kernel with bootinfo version 1.0 (up
# to 2.0.x)
#
BOOTOPTS = -DBOOTINFO_COMPAT_1_0 # -DAOUT_KERNEL
USE_BOOTP = n
# where to install
PREFIX =
# define with path to Linux/68k kernel headers, if not in the standard
# places /usr/local/m68k-linux/include/linux, /usr/m68k-linux/include/linux,
# or /usr/include/linux.
# KERNEL_HEADERS = $(HOME)/src/linux/include
ifneq ($(USE_BOOTP),n)
BOOTOPTS += -DUSE_BOOTP
endif
TOPDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
# it doesn't make sense to build a cross-lilo, so hardwire the target arch
CC = m68k-linux-gcc
CFLAGS = -m68060 -O2 -fomit-frame-pointer -Wall
AMIGA_HOSTCC = m68k-cbm-amigados-gcc
AMIGA_HOSTINC =
AMIGA_HOSTFLAGS = -m68030 -O2 -Wall -Dlinux
AMIGA_HOSTAR = m68k-cbm-amigados-ar
ATARI_HOSTCC = m68k-atari-mint-gcc
ATARI_HOSTINC =
ATARI_HOSTFLAGS = -m68030 -m68881 -Dlinux -O2 -fomit-frame-pointer \
-Wall
ATARI_HOSTAR = m68k-mint-ar
.EXPORT_ALL_VARIABLES:
.PHONY: amiga amiga-bootstrap amiga-lilo amiga-common \
atari atari-bootstrap atari-lilo atari-common \
all clean distclean dep
all: amiga atari doc
amiga: amiga-bootstrap amiga-lilo
atari: atari-bootstrap atari-lilo
amiga-bootstrap:
$(MAKE) -C bootstrap MACH=amiga
atari-bootstrap:
$(MAKE) -C bootstrap MACH=atari
amiga-lilo:
$(MAKE) -C lilo MACH=amiga
atari-lilo:
$(MAKE) -C lilo MACH=atari
doc:
$(MAKE) -C doc
clean:
$(MAKE) -C bootstrap clean
$(MAKE) -C lilo clean
$(MAKE) -C doc clean
distclean:
$(MAKE) -C bootstrap distclean
$(MAKE) -C lilo distclean
$(MAKE) -C doc distclean
rm -f TAGS
find . -name '.#' -o -name '.new.*' -o -name '#*#' -o \
-name '*~' -exec rm {} \;
dep:
if $(AMIGA_HOSTCC) -v >/dev/null 2>&1; then \
$(MAKE) -C bootstrap dep MACH=amiga; \
$(MAKE) -C lilo dep MACH=amiga; \
fi
if $(ATARI_HOSTCC) -v >/dev/null 2>&1; then \
$(MAKE) -C bootstrap dep MACH=atari; \
$(MAKE) -C lilo dep MACH=atari; \
fi
install:
./do_install "$(PREFIX)" $(MACH)
$(MAKE) -C doc install PREFIX=$(PREFIX)
binary:
doit=""; [ root = "`whoami`" ] || doit=sudo; $$doit ./make_binary
release:
@if [ "x$(VER)" = "x" ]; then \
echo "Usage: make release VER=<release-number>"; \
exit 1; \
fi
modified=`cvs status 2>/dev/null | awk '/Status:/ { if ($$4 != "Up-to-date") print $$2 }'`; \
if [ "x$$modified" != "x" ]; then \
echo "There are modified files: $$modified"; \
echo "Commit first"; \
exit 1; \
fi
sed "/VERSION/s/\".*\"/\"$(VER)\"/" <version.h >version.h.new
mv version.h.new version.h
cvs commit -m"Raised version to $(VER)" version.h
cvs tag RELEASE-`echo $(VER) | sed 's/\./-/g'`
check-modified:
@modified=`cvs status 2>&1 | awk 'BEGIN { OFS="" } /Examining/ { dir=$$NF } /Status:/ { if ($$4 == "Locally" && $$5 == "Modified") print dir, "/", $$2 }'`; \
if [ "x$$modified" = "x" ]; then \
echo "No modified files."; \
else \
echo "Modified files:"; \
echo $$modified | tr ' ' '\n'; \
fi
check-need:
@cvs status 2>&1 | awk 'BEGIN { OFS="" } /Examining/ { dir=$$NF } /Status:/ { if ($$4 == "Needs") print dir, "/", $$2, ": ", $$4, " ", $$5 }'
bootstrap/%.i bootstrap/%.s:
$(MAKE) -C bootstrap MACH=$(dir $(subst bootstrap/,,$@)) $(subst bootstrap/,,$@)
lilo/%.i lilo/%.s:
$(MAKE) -C lilo MACH=$(dir $(subst lilo/,,$@)) $(subst lilo/,,$@)
TAGS:
etags `find . -name '*.[ch]'`
tar: distclean
cd ..; \
name="$(notdir $(shell pwd))"; \
namev="$$name-$(shell perl -ne 'print "$$1\n" if /VERSION.*"(\S+)"/;' version.h)"; \
mv $$name $$namev; \
tar cf $$namev.tar `find $$namev -path $$namev/CVS -prune -o -type f -print`; \
gzip -9f $$namev.tar; \
mv $$namev $$name
diff: distclean
@if [ "x$(OLDVER)" = "x" ]; then \
echo "Usage: make diff OLDVER=<last-release-tag>