-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
124 lines (107 loc) · 3.55 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
# Makefile for creating Basilisk II distributions
# Written in 2002 by Christian Bauer <[email protected]>
VERSION := $(shell sed <BasiliskII.spec -n '/^\%define version */s///p')
RELEASE := $(shell sed <BasiliskII.spec -n '/^\%define release */s///p')
VERNAME := BasiliskII-$(VERSION)
SRCARCHIVE := $(shell date +BasiliskII_src_%d%m%Y.tar.gz)
AMIGAARCHIVE := $(VERNAME)-$(RELEASE).amiga.lzh
BEOSPPCARCHIVE := $(VERNAME)-$(RELEASE).beosppc.zip
BEOSX86ARCHIVE := $(VERNAME)-$(RELEASE).beosx86.zip
MACOSXARCHIVE := $(VERNAME)-$(RELEASE).tar.gz
TMPDIR := $(shell date +/tmp/build%M%S)
ISODATE := $(shell date "+%Y-%m-%d %H:%M")
DOCS := $(shell sed <BasiliskII.spec -n '/^\%doc */s///p')
SRCS := src
default:
@echo "This top-level Makefile is for creating Basilisk II distributions."
@echo "If you want to install Basilisk II V$(VERSION) on your system, please follow"
@echo "the instructions in the file INSTALL."
@echo "If you want to create a Basilisk II V$(VERSION) distribution, type \"make help\""
@echo "to get a list of possible targets."
help:
@echo "The following targets are available:"
@echo " tarball source tarball ($(SRCARCHIVE))"
@echo " rpm source and binary RPMs"
@echo " amiga AmigaOS binary archive ($(AMIGAARCHIVE))"
@echo " beosppc BeOS/ppc binary archive ($(BEOSPPCARCHIVE))"
@echo " beosx86 BeOS/x86 binary archive ($(BEOSX86ARCHIVE))"
@echo " macosx MacOS X binary archive ($(MACOSXARCHIVE))"
clean:
-rm -f $(SRCARCHIVE)
-rm -f $(AMIGAARCHIVE) $(BEOSPPCARCHIVE) $(BEOSX86ARCHIVE)
#
# Source tarball
#
tarball: $(SRCARCHIVE)
$(SRCARCHIVE): $(SRCS) $(DOCS)
-rm -rf $(TMPDIR)
mkdir $(TMPDIR)
cd $(TMPDIR); cvs export -D "$(ISODATE)" BasiliskII
cd $(TMPDIR)/BasiliskII/src/Unix && NO_CONFIGURE=1 ./autogen.sh
cd $(TMPDIR)/BasiliskII/src/Windows && NO_CONFIGURE=1 ../Unix/autogen.sh
rm $(TMPDIR)/BasiliskII/Makefile
mv $(TMPDIR)/BasiliskII $(TMPDIR)/$(VERNAME)
cd $(TMPDIR); tar cfz $@ $(VERNAME)
mv $(TMPDIR)/$@ .
rm -rf $(TMPDIR)
#
# RPMs (source and binary)
#
rpm: $(SRCARCHIVE)
rpmbuild -ta --clean $(SRCARCHIVE)
#
# Binary archive for AmigaOS
#
amiga: $(AMIGAARCHIVE)
$(AMIGAARCHIVE): $(SRCS) $(DOCS) src/AmigaOS/BasiliskII
-rm -rf $(TMPDIR)
mkdir $(TMPDIR)
mkdir $(TMPDIR)/$(VERNAME)
cp $(DOCS) $(TMPDIR)/$(VERNAME)
cp src/AmigaOS/BasiliskII $(TMPDIR)/$(VERNAME)
cp src/AmigaOS/BasiliskII.info $(TMPDIR)/$(VERNAME)
chmod 775 $(TMPDIR)/$(VERNAME)/BasiliskII
cd $(TMPDIR); lha a $@ $(VERNAME)
mv $(TMPDIR)/$@ .
rm -rf $(TMPDIR)
#
# Binary archive for BeOS/ppc
#
beosppc: $(BEOSPPCARCHIVE)
$(BEOSPPCARCHIVE): $(SRCS) $(DOCS) src/BeOS/obj.ppc/BasiliskII
-rm -rf $(TMPDIR)
mkdir $(TMPDIR)
mkdir $(TMPDIR)/$(VERNAME)
cp $(DOCS) $(TMPDIR)/$(VERNAME)
cp src/BeOS/obj.ppc/BasiliskII $(TMPDIR)/$(VERNAME)
mimeset -f $(TMPDIR)
cd $(TMPDIR); zip -ry $@ $(VERNAME)/
mv $(TMPDIR)/$@ .
rm -rf $(TMPDIR)
#
# Binary archive for BeOS/x86
#
beosx86: $(BEOSX86ARCHIVE)
$(BEOSX86ARCHIVE): $(SRCS) $(DOCS) src/BeOS/obj.x86/BasiliskII
-rm -rf $(TMPDIR)
mkdir $(TMPDIR)
mkdir $(TMPDIR)/$(VERNAME)
cp $(DOCS) $(TMPDIR)/$(VERNAME)
cp src/BeOS/obj.x86/BasiliskII $(TMPDIR)/$(VERNAME)
mimeset -f $(TMPDIR)
cd $(TMPDIR); zip -ry $@ $(VERNAME)/
mv $(TMPDIR)/$@ .
rm -rf $(TMPDIR)
#
# Binary archive for MacOS X
#
macosx: $(MACOSXARCHIVE)
$(MACOSXARCHIVE): $(SRCS) $(DOCS) src/MacOSX/build/BasiliskII.app
-rm -rf $(TMPDIR)
mkdir $(TMPDIR)
mkdir $(TMPDIR)/$(VERNAME)
cp $(DOCS) $(TMPDIR)/$(VERNAME)
cp -pr src/MacOSX/build/BasiliskII.app $(TMPDIR)/$(VERNAME)
cd $(TMPDIR); tar -czvf $@ $(VERNAME)/
mv $(TMPDIR)/$@ .
rm -rf $(TMPDIR)