1 |
# Makefile for creating Basilisk II distributions |
2 |
# Written in 1999 by Christian Bauer <Christian.Bauer@uni-mainz.de> |
3 |
|
4 |
VERSION := $(shell sed <BasiliskII.spec -n '/^Version: */s///p') |
5 |
RELEASE := $(shell sed <BasiliskII.spec -n '/^Release: */s///p') |
6 |
VERNAME := BasiliskII-$(VERSION) |
7 |
|
8 |
SRCARCHIVE := $(shell date +BasiliskII_src_%d%m%Y.tar.gz) |
9 |
SRCRPM := $(VERNAME)-$(RELEASE).src.rpm |
10 |
BINRPM := $(VERNAME)-$(RELEASE).i386.rpm |
11 |
AMIGAARCHIVE := $(VERNAME)-$(RELEASE).amiga.lha |
12 |
BEOSPPCARCHIVE := $(VERNAME)-$(RELEASE).beosppc.zip |
13 |
BEOSX86ARCHIVE := $(VERNAME)-$(RELEASE).beosx86.zip |
14 |
|
15 |
TMPDIR := $(shell date +/tmp/build%M%S) |
16 |
RPMDIR := /usr/src/redhat |
17 |
ISODATE := $(shell date "+%Y-%m-%d %H:%M") |
18 |
DOCS := $(shell sed <BasiliskII.spec -n '/^\%doc */s///p') |
19 |
SRCS := src |
20 |
|
21 |
default: |
22 |
@echo "This top-level Makefile is for creating Basilisk II distributions." |
23 |
@echo "If you want to install Basilisk II V$(VERSION) on your system, please follow" |
24 |
@echo "the instructions in the file INSTALL." |
25 |
@echo "If you want to create a Basilisk II V$(VERSION) distribution, type \"make help\"" |
26 |
@echo "to get a list of possible targets." |
27 |
|
28 |
help: |
29 |
@echo "The following targets are available:" |
30 |
@echo " tarball source tarball ($(SRCARCHIVE))" |
31 |
@echo " rpm source and binary RPMs ($(SRCRPM) and $(BINRPM))" |
32 |
@echo " amiga AmigaOS binary archive ($(AMIGAARCHIVE))" |
33 |
@echo " beosppc BeOS/ppc binary archive ($(BEOSPPCARCHIVE))" |
34 |
@echo " beosx86 BeOS/x86 binary archive ($(BEOSX86ARCHIVE))" |
35 |
|
36 |
clean: |
37 |
-rm -f $(SRCARCHIVE) |
38 |
-rm -f $(SRCRPM) $(BINRPM) |
39 |
-rm -f $(AMIGAARCHIVE) $(BEOSPPCARCHIVE) $(BEOSX86ARCHIVE) |
40 |
|
41 |
# |
42 |
# Source tarball |
43 |
# |
44 |
tarball: $(SRCARCHIVE) |
45 |
|
46 |
$(SRCARCHIVE): $(SRCS) $(DOCS) |
47 |
-rm -rf $(TMPDIR) |
48 |
mkdir $(TMPDIR) |
49 |
cd $(TMPDIR); cvs export -D "$(ISODATE)" BasiliskII |
50 |
rm -rf $(TMPDIR)/BasiliskII/src/powerrom_cpu #not yet ready for distribution |
51 |
mv $(TMPDIR)/BasiliskII $(TMPDIR)/$(VERNAME) |
52 |
cd $(TMPDIR); tar cfz $@ $(VERNAME) |
53 |
mv $(TMPDIR)/$@ . |
54 |
rm -rf $(TMPDIR) |
55 |
|
56 |
# |
57 |
# RPMs (source and i386 binary) |
58 |
# |
59 |
rpm: $(SRCRPM) $(BINRPM) |
60 |
|
61 |
$(RPMDIR)/SOURCES/$(SRCARCHIVE): $(SRCARCHIVE) |
62 |
cp $(SRCARCHIVE) $(RPMDIR)/SOURCES |
63 |
|
64 |
$(RPMDIR)/SRPMS/$(SRCRPM) $(RPMDIR)/RPMS/i386/$(BINRPM): $(RPMDIR)/SOURCES/$(SRCARCHIVE) BasiliskII.spec |
65 |
rpm -ba BasiliskII.spec |
66 |
|
67 |
$(SRCRPM): $(RPMDIR)/SRPMS/$(SRCRPM) |
68 |
cp $(RPMDIR)/SRPMS/$(SRCRPM) . |
69 |
|
70 |
$(BINRPM): $(RPMDIR)/RPMS/i386/$(BINRPM) |
71 |
cp $(RPMDIR)/RPMS/i386/$(BINRPM) . |
72 |
|
73 |
# |
74 |
# Binary archive for AmigaOS |
75 |
# |
76 |
amiga: $(AMIGAARCHIVE) |
77 |
|
78 |
$(AMIGAARCHIVE): $(SRCS) $(DOCS) src/AmigaOS/BasiliskII |
79 |
-rm -rf $(TMPDIR) |
80 |
mkdir $(TMPDIR) |
81 |
mkdir $(TMPDIR)/$(VERNAME) |
82 |
cp $(DOCS) $(TMPDIR)/$(VERNAME) |
83 |
cp src/AmigaOS/BasiliskII $(TMPDIR)/$(VERNAME) |
84 |
cp src/AmigaOS/BasiliskII.info $(TMPDIR)/$(VERNAME) |
85 |
chmod 775 $(TMPDIR)/$(VERNAME)/BasiliskII |
86 |
cd $(TMPDIR); lha a $@ $(VERNAME) |
87 |
mv $(TMPDIR)/$@ . |
88 |
rm -rf $(TMPDIR) |
89 |
|
90 |
# |
91 |
# Binary archive for BeOS/ppc |
92 |
# |
93 |
beosppc: $(BEOSPPCARCHIVE) |
94 |
|
95 |
$(BEOSPPCARCHIVE): $(SRCS) $(DOCS) src/BeOS/obj.ppc/BasiliskII |
96 |
-rm -rf $(TMPDIR) |
97 |
mkdir $(TMPDIR) |
98 |
mkdir $(TMPDIR)/$(VERNAME) |
99 |
cp $(DOCS) $(TMPDIR)/$(VERNAME) |
100 |
cp src/BeOS/obj.ppc/BasiliskII $(TMPDIR)/$(VERNAME) |
101 |
mimeset -f $(TMPDIR) |
102 |
cd $(TMPDIR); zip -ry $@ $(VERNAME)/ |
103 |
mv $(TMPDIR)/$@ . |
104 |
rm -rf $(TMPDIR) |
105 |
|
106 |
# |
107 |
# Binary archive for BeOS/x86 |
108 |
# |
109 |
beosx86: $(BEOSX86ARCHIVE) |
110 |
|
111 |
$(BEOSX86ARCHIVE): $(SRCS) $(DOCS) src/BeOS/obj.x86/BasiliskII |
112 |
-rm -rf $(TMPDIR) |
113 |
mkdir $(TMPDIR) |
114 |
mkdir $(TMPDIR)/$(VERNAME) |
115 |
cp $(DOCS) $(TMPDIR)/$(VERNAME) |
116 |
cp src/BeOS/obj.x86/BasiliskII $(TMPDIR)/$(VERNAME) |
117 |
mimeset -f $(TMPDIR) |
118 |
cd $(TMPDIR); zip -ry $@ $(VERNAME)/ |
119 |
mv $(TMPDIR)/$@ . |
120 |
rm -rf $(TMPDIR) |