]> git.zerfleddert.de Git - micropolis/blame - Makefile
src/tclx/tkucbsrc/makefile: Micropolis build fixes for recent macOS
[micropolis] / Makefile
CommitLineData
7709f34c
MG
1PREFIX=/usr/local
2DATADIR=$(PREFIX)/share/micropolis
e049e4ba 3LIBEXECDIR=$(PREFIX)/libexec/micropolis
7709f34c
MG
4BINDIR=$(PREFIX)/bin
5DOCDIR=$(PREFIX)/share/doc/micropolis
146092b8
MG
6PIXMAPDIR=$(PREFIX)/share/pixmaps
7APPLICATIONSDIR=$(PREFIX)/share/applications
7709f34c
MG
8
9INSTALL=install
10
7fe1e6c0
MG
11DIRS= $(DESTDIR)/$(DATADIR)/res/sounds $(DESTDIR)/$(DATADIR)/res/dejavu-lgc \
12 $(DESTDIR)/$(DATADIR)/images $(DESTDIR)/$(DATADIR)/cities \
146092b8
MG
13 $(DESTDIR)/$(LIBEXECDIR) $(DESTDIR)/$(BINDIR) $(DESTDIR)/$(DOCDIR) \
14 $(DESTDIR)/$(PIXMAPDIR) $(DESTDIR)/$(APPLICATIONSDIR)
7709f34c
MG
15
16RES= res/buildidx.tcl res/button.tcl res/entry.tcl res/help.tcl res/hexa.112 \
17 res/hexa.232 res/hexa.384 res/hexa.385 res/hexa.386 res/hexa.387 \
18 res/hexa.388 res/hexa.456 res/hexa.544 res/hexa.563 res/hexa.999 \
19 res/init.tcl res/listbox.tcl res/menu.tcl res/micropolis.tcl \
20 res/mkindex.tcl res/parray.tcl res/snro.111 res/snro.222 res/snro.333 \
21 res/snro.444 res/snro.555 res/snro.666 res/snro.777 res/snro.888 \
22 res/sound.tcl res/stri.202 res/stri.219 res/stri.301 res/stri.356 \
23 res/tcl.tdx res/tcl.tlb res/tclindex res/tclinit.tcl res/text.tcl \
24 res/tk.tcl res/tk.tdx res/tk.tlb res/tkerror.tcl res/wask.tcl \
25 res/wbudget.tcl res/weditor.tcl res/weval.tcl res/wfile.tcl \
26 res/wfrob.tcl res/wgraph.tcl res/whead.tcl res/whelp.tcl res/wish.tcl \
27 res/wishx.tcl res/wmap.tcl res/wnotice.tcl res/wplayer.tcl \
28 res/wscen.tcl res/wsplash.tcl
29
eb667c9f
MG
30all: res/sim
31
32res/sim: src/sim/sim
7709f34c 33 cp src/sim/sim $@
eb667c9f
MG
34 strip $@
35
7709f34c
MG
36src/sim/sim: tcl tk tclx sim
37 @#
eb667c9f
MG
38
39tcl:
7709f34c 40 cd src/tcl && $(MAKE) MAKEFLAGS=
eb667c9f
MG
41
42tk:
7709f34c 43 cd src/tk && $(MAKE) MAKEFLAGS=
eb667c9f
MG
44
45tclx:
7709f34c 46 cd src/tclx && $(MAKE) MAKEFLAGS=
eb667c9f
MG
47
48sim:
7709f34c 49 cd src/sim && $(MAKE) MAKEFLAGS=
eb667c9f
MG
50
51clean:
7709f34c
MG
52 cd src/sim && $(MAKE) MAKEFLAGS= $@
53 cd src/tcl && $(MAKE) MAKEFLAGS= $@
54 cd src/tk && $(MAKE) MAKEFLAGS= $@
55 cd src/tclx && $(MAKE) MAKEFLAGS= $@
eb667c9f
MG
56 rm -f res/sim
57
146092b8
MG
58install: res/sim install-dirs install-bin install-res install-images \
59 install-cities install-doc install-desktop
7709f34c
MG
60
61install-dirs:
62 $(INSTALL) -d $(DIRS)
63
64install-bin:
7fe1e6c0
MG
65 $(INSTALL) -m 0755 res/sim $(DESTDIR)/$(LIBEXECDIR)/sim
66 $(INSTALL) -m 0755 res/sounds/player $(DESTDIR)/$(DATADIR)/res/sounds/player
e049e4ba
RS
67 echo "#!/bin/sh" >$(DESTDIR)/$(BINDIR)/micropolis
68 echo "SIMHOME=$(DATADIR); export SIMHOME" >>$(DESTDIR)/$(BINDIR)/micropolis
146092b8 69 echo "echo \"Starting Micropolis in \$${SIMHOME} ... \"" >>$(DESTDIR)/$(BINDIR)/micropolis
e049e4ba 70 echo "cd $(DATADIR) && exec $(LIBEXECDIR)/sim \"\$$@\"" >>$(DESTDIR)/$(BINDIR)/micropolis
146092b8 71 chmod 755 $(DESTDIR)/$(BINDIR)/micropolis
7709f34c
MG
72
73install-res: install-res-sounds install-res-dejavu-lgc
74 for file in $(RES); do \
7fe1e6c0 75 install -m 0644 $$file $(DESTDIR)/$(DATADIR)/$$file; \
7709f34c
MG
76 done
77
78install-res-sounds:
7fe1e6c0 79 find res/sounds -type f -name \*.wav -exec $(INSTALL) -m 0644 {} $(DESTDIR)/$(DATADIR)/res/sounds/ \;
7709f34c
MG
80
81install-res-dejavu-lgc:
7fe1e6c0 82 find res/dejavu-lgc -type f -exec $(INSTALL) -m 0644 {} $(DESTDIR)/$(DATADIR)/res/dejavu-lgc/ \;
7709f34c
MG
83
84install-images:
7fe1e6c0 85 find images -type f -exec $(INSTALL) -m 0644 {} $(DESTDIR)/$(DATADIR)/images/ \;
7709f34c
MG
86
87install-cities:
7fe1e6c0 88 find cities -type f -exec $(INSTALL) -m 0644 {} $(DESTDIR)/$(DATADIR)/cities/ \;
7709f34c
MG
89
90install-doc:
7fe1e6c0 91 find manual -type f -exec $(INSTALL) -m 0644 {} $(DESTDIR)/$(DOCDIR)/ \;
7709f34c 92
146092b8
MG
93install-desktop:
94 $(INSTALL) -m 0644 Micropolis.desktop $(DESTDIR)/$(APPLICATIONSDIR)/micropolis.desktop
95 $(INSTALL) -m 0644 Micropolis.png $(DESTDIR)/$(PIXMAPDIR)/micropolis.png
96
9178fb32
MG
97uninstall:
98 rm -f $(DESTDIR)/$(BINDIR)/micropolis
99 rm -f $(DESTDIR)/$(LIBEXECDIR)/sim
100 -rmdir $(DESTDIR)/$(LIBEXECDIR)
101 rm -f $(DESTDIR)/$(DATADIR)/res/sounds/player
102 rm -f $(DESTDIR)/$(DATADIR)/res/sounds/*.wav
103 -rmdir $(DESTDIR)/$(DATADIR)/res/sounds
104 rm -f $(DESTDIR)/$(DATADIR)/res/dejavu-lgc/*ttf \
105 $(DESTDIR)/$(DATADIR)/res/dejavu-lgc/fonts.alias \
106 $(DESTDIR)/$(DATADIR)/res/dejavu-lgc/fonts.dir \
107 $(DESTDIR)/$(DATADIR)/res/dejavu-lgc/fonts.scale
108 -rmdir $(DESTDIR)/$(DATADIR)/res/dejavu-lgc
109 for file in $(RES); do \
110 rm $(DESTDIR)/$(DATADIR)/$$file; \
111 done
112 -rmdir $(DESTDIR)/$(DATADIR)/res
113 rm -f $(DESTDIR)/$(DATADIR)/images/*.xpm
114 -rmdir $(DESTDIR)/$(DATADIR)/images
115 rm -f $(DESTDIR)/$(DATADIR)/cities/*.cty
116 -rmdir $(DESTDIR)/$(DATADIR)/cities
117 -rmdir $(DESTDIR)/$(DATADIR)
118 rm -f $(DESTDIR)/$(DOCDIR)/*.html $(DESTDIR)/$(DOCDIR)/README
119 -rmdir $(DESTDIR)/$(DOCDIR)
120 rm -f $(DESTDIR)/$(APPLICATIONSDIR)/micropolis.desktop
121 rm -f $(DESTDIR)/$(PIXMAPDIR)/micropolis.png
122
7709f34c
MG
123.PHONY: all clean install install-dirs install-bin install-res \
124 install-res-sounds install-res-dejavu-lgc install-images \
9178fb32 125 install-cities install-doc install-desktop uninstall tcl tk tclx sim
Impressum, Datenschutz