-
Notifications
You must be signed in to change notification settings - Fork 44
/
Makefile
71 lines (59 loc) · 2.28 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
# Copyright (C) 1997 Robert de Bath <[email protected]>
# This file is part of the Linux-8086 Development environment and is
# distributed under the GNU General Public License.
VERSION=0.16.21
TARGETS=install clean other \
bcc86 unproto copt as86 ld86 elksemu \
install-all install-bcc install-emu install-lib \
install-lib2 install-ln install-man install-other \
all-libs alt-libs library lib-386 lib-bsd lib-dos lib-fast lib-stand \
config tests dis88 doselks bootblocks ld86r
ELKSSRC= /usr/src/elks
PREFIX= /usr
BINDIR= $(PREFIX)/bin
LIBDIR= $(PREFIX)/lib/bcc
INCLDIR= $(PREFIX)/lib/bcc
ASLDDIR= $(BINDIR)
MANDIR= $(PREFIX)/man
CFLAGS= -O
IFDEFNAME= ifdef
# Some makes take the last of a list as the default ...
all: make.fil
PATH="`pwd`/bin:$$PATH" $(MAKE) -f make.fil VERSION=$(VERSION) TOPDIR=`pwd` $@
$(TARGETS): make.fil
PATH="`pwd`/bin:$$PATH" $(MAKE) -f make.fil VERSION=$(VERSION) TOPDIR=`pwd` $@
$(TARGETS):
ld: ld86
as: as86
realclean:
-[ ! -f make.fil ] || $(MAKE) -f make.fil VERSION=$(VERSION) TOPDIR=`pwd` $@
-rm -f make.fil ifdef ifdefg
make.fil: $(IFDEFNAME) makefile.in
./$(IFDEFNAME) -MU $(IFDEFOPTS) makefile.in >tmp.mak
echo > tmp.sed
[ "$(BINDIR)" != "//bin" ] || echo >> tmp.sed "s:%BINDIR%:/bin:"
[ "$(LIBDIR)" != "//lib/bcc" ] || echo >> tmp.sed "s:%LIBDIR%:/lib:"
[ "$(INCLDIR)" != "//lib/bcc" ] || echo >> tmp.sed "s:%INCLDIR%:/usr:"
[ "$(ASLDDIR)" != "//bin" ] || echo >> tmp.sed "s:%ASLDDIR%:/bin:"
[ "$(MANDIR)" != "//man" ] || echo >> tmp.sed "s:%MANDIR%:/usr/man:"
echo >> tmp.sed "s:%PREFIX%:$(PREFIX):"
echo >> tmp.sed "s:%BINDIR%:$(BINDIR):"
echo >> tmp.sed "s:%INCLDIR%:$(INCLDIR):"
echo >> tmp.sed "s:%LIBDIR%:$(LIBDIR):"
echo >> tmp.sed "s:%ASLDDIR%:$(ASLDDIR):"
echo >> tmp.sed "s:%MANDIR%:$(MANDIR):"
echo >> tmp.sed "s:%ELKSSRC%:$(ELKSSRC):"
echo >> tmp.sed "s:%CC%:$(CC):"
echo >> tmp.sed "s:%CFLAGS%:$(CFLAGS):"
echo >> tmp.sed "s:%LDFLAGS%:$(LDFLAGS):"
sed -f tmp.sed < tmp.mak > make.tmp
mv -f make.tmp make.fil
@rm -f tmp.mak tmp.sed
$(IFDEFNAME): ifdef.c
$(CC) $(IFDEFARCH) $(CFLAGS) $(IFDEFFLAGS) $(LDFLAGS) -o $(IFDEFNAME) ifdef.c
uninstall:
@echo 'Sorry, no go; it was just wrong.'
false
distribution:
@[ `id -u` -eq 0 ] || fakeroot -- sh ./Mk_dist $(VERSION)
@[ `id -u` -ne 0 ] || sh ./Mk_dist $(VERSION)