annotate Makefile @ 85:011e65a6367b

Fix build again.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 15 Mar 2013 21:29:28 +0200
parents 969fff31e495
children dc95ef77a6ad
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
23
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
1 ### Global settings
33
8b2b0677eb99 Build system changes for SDL/Win32 cross-build via MinGW hosted on Linux.
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
2 CFLAGS += -W -Wall -O3
24
78235ee17b69 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 23
diff changeset
3 LDFLAGS +=
49
4698627de33d Use ranlib when building pwplib.a.
Matti Hamalainen <ccr@tnsp.org>
parents: 47
diff changeset
4 RANLIB=ranlib
4698627de33d Use ranlib when building pwplib.a.
Matti Hamalainen <ccr@tnsp.org>
parents: 47
diff changeset
5
73
1096f6ffd15c Adjustments for w64 builds.
Matti Hamalainen <ccr@tnsp.org>
parents: 71
diff changeset
6 # Prefix for x86-32 win32 MinGW tools (gcc, ar, ld, ranlib)
71
a87eb778f225 Improvements to the MinGW crossbuild. Should now build with default tools
Matti Hamalainen <ccr@tnsp.org>
parents: 66
diff changeset
7 MINGW32_PREFIX=i686-w64-mingw32-
a87eb778f225 Improvements to the MinGW crossbuild. Should now build with default tools
Matti Hamalainen <ccr@tnsp.org>
parents: 66
diff changeset
8 MINGW32_PATH=/usr/i686-w64-mingw32
73
1096f6ffd15c Adjustments for w64 builds.
Matti Hamalainen <ccr@tnsp.org>
parents: 71
diff changeset
9
1096f6ffd15c Adjustments for w64 builds.
Matti Hamalainen <ccr@tnsp.org>
parents: 71
diff changeset
10 # Prefix for x86-64 win64 MinGW tools
71
a87eb778f225 Improvements to the MinGW crossbuild. Should now build with default tools
Matti Hamalainen <ccr@tnsp.org>
parents: 66
diff changeset
11 MINGW64_PREFIX=x86_64-w64-mingw32-
73
1096f6ffd15c Adjustments for w64 builds.
Matti Hamalainen <ccr@tnsp.org>
parents: 71
diff changeset
12 MINGW64_PATH=/usr/x86_64-w64-mingw32
23
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
13
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
14 ### Subdirectories to build
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
15 SUBDIRS=pwplib peluce nykyaeka oldchsool pwpzax
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
16
23
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
17 ### Show some help
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
18 help:
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
19 @if test ! -f config.mak; then \
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
20 echo "PWPLib build system"; \
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
21 echo "Usage: make <target>"; \
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
22 echo ""; \
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
23 echo "sdl - LibSDL video/audio for POSIX style systems"; \
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
24 echo "unix - Terminal only POSIX style systems"; \
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
25 echo "linux - Like unix, but with Linux console and OSS audio support"; \
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
26 echo "hpux - HP-UX (untested now)"; \
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
27 echo "sdl-win32 - LibSDL for Win32, cross compilation via MinGW toolchain"; \
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
28 echo "sdl-win64 - Like above, but for Win64 via MinGW64"; \
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
29 echo ""; \
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
30 else \
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
31 echo "Configured as:"; \
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
32 cat config.mak; \
24
78235ee17b69 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 23
diff changeset
33 echo "To re-build: 'make all'"; \
78235ee17b69 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 23
diff changeset
34 echo "To reconfigure: 'make clean' and 'make <target>'"; \
23
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
35 fi
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
36
23
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
37 endianchk: endianchk.c
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
38 $(CC) -o $@ $<
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
39
23
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
40 config.mak:
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
41 @echo "" > $@
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
42 @echo "# Build target: $(XTARGET)" >> $@
38
678924af9149 Buildsystem changes, build zaxplay or orig only when the target probably allows it.
Matti Hamalainen <ccr@tnsp.org>
parents: 33
diff changeset
43 @echo "XTARGET=$(XTARGET)" >> $@
71
a87eb778f225 Improvements to the MinGW crossbuild. Should now build with default tools
Matti Hamalainen <ccr@tnsp.org>
parents: 66
diff changeset
44 @echo "CC=$(PREFIX)$(CC)" >> $@
a87eb778f225 Improvements to the MinGW crossbuild. Should now build with default tools
Matti Hamalainen <ccr@tnsp.org>
parents: 66
diff changeset
45 @echo "AR=$(PREFIX)$(AR)" >> $@
a87eb778f225 Improvements to the MinGW crossbuild. Should now build with default tools
Matti Hamalainen <ccr@tnsp.org>
parents: 66
diff changeset
46 @echo "LD=$(PREFIX)$(LD)" >> $@
a87eb778f225 Improvements to the MinGW crossbuild. Should now build with default tools
Matti Hamalainen <ccr@tnsp.org>
parents: 66
diff changeset
47 @echo "RANLIB=$(PREFIX)$(RANLIB)" >> $@
23
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
48 @echo "CFLAGS=$(CFLAGS) $(XCFLAGS)" >> $@
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
49 @echo "LDFLAGS=$(LDFLAGS) $(XLDFLAGS)" >> $@
33
8b2b0677eb99 Build system changes for SDL/Win32 cross-build via MinGW hosted on Linux.
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
50 @echo "BINEXT=$(BINEXT)" >> $@
23
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
51 @echo "" >> $@
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
52
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
53 ### Build sub targets
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
54 all:
33
8b2b0677eb99 Build system changes for SDL/Win32 cross-build via MinGW hosted on Linux.
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
55 @for subdir in $(SUBDIRS); do if ! $(MAKE) -C "$$subdir"; then echo "Make returned $?"; exit 1; fi; done
23
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
56
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
57 pwplib.a:
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
58 $(MAKE) -C pwplib
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
59
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
60 clean:
23
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
61 @for subdir in $(SUBDIRS); do $(MAKE) -C "$$subdir" clean; done
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
62 $(RM) config.mak endianchk
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
63
23
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
64 ### Major targets
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
65 unix: endianchk
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
66 $(RM) config.mak && endianflags=`./endianchk` && \
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
67 $(MAKE) config.mak XTARGET="$@" XCFLAGS="-DUNIX $$endianflags" XLDFLAGS="-lm" && \
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
68 $(MAKE) all
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
69
23
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
70 hpux:
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
71 $(RM) config.mak && \
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
72 $(MAKE) config.mak XTARGET="$@" XCFLAGS="-DUNIX -DBIG_ENDIAN -DDRIVE_HPUX" XLDFLAGS="-lm" && \
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
73 $(MAKE) all
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
74
23
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
75 linux: endianchk
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
76 $(RM) config.mak && endianflags=`./endianchk` && \
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
77 $(MAKE) config.mak XTARGET="$@" XCFLAGS="-DUNIX -DDRIVE_LINUXCON -DDRIVE_OSS $$endianflags" XLDFLAGS="-lm" && \
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
78 $(MAKE) all
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
79
23
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
80 sdl: endianchk
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
81 $(RM) config.mak && endianflags=`./endianchk` && \
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
82 $(MAKE) config.mak XTARGET="$@" XCFLAGS="-DUNIX -DDRIVE_SDL $$endianflags `sdl-config --cflags`" XLDFLAGS="`sdl-config --libs` -lm" && \
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
83 $(MAKE) all
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
84
38
678924af9149 Buildsystem changes, build zaxplay or orig only when the target probably allows it.
Matti Hamalainen <ccr@tnsp.org>
parents: 33
diff changeset
85 sdl-win32:
23
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
86 $(RM) config.mak && \
71
a87eb778f225 Improvements to the MinGW crossbuild. Should now build with default tools
Matti Hamalainen <ccr@tnsp.org>
parents: 66
diff changeset
87 $(MAKE) config.mak PREFIX="$(MINGW32_PREFIX)" BINEXT=".exe" CC="gcc" \
38
678924af9149 Buildsystem changes, build zaxplay or orig only when the target probably allows it.
Matti Hamalainen <ccr@tnsp.org>
parents: 33
diff changeset
88 XTARGET="$@" XCFLAGS="-DDRIVE_SDL `$(MINGW32_PATH)/bin/sdl-config --cflags`" \
85
011e65a6367b Fix build again.
Matti Hamalainen <ccr@tnsp.org>
parents: 84
diff changeset
89 XLDFLAGS="-s -L$(MINGW32_PATH)/lib/ -lm -lmingw32 `$(MINGW32_PATH)/bin/sdl-config --libs` -lSDL" && \
38
678924af9149 Buildsystem changes, build zaxplay or orig only when the target probably allows it.
Matti Hamalainen <ccr@tnsp.org>
parents: 33
diff changeset
90 $(MAKE) all
678924af9149 Buildsystem changes, build zaxplay or orig only when the target probably allows it.
Matti Hamalainen <ccr@tnsp.org>
parents: 33
diff changeset
91
678924af9149 Buildsystem changes, build zaxplay or orig only when the target probably allows it.
Matti Hamalainen <ccr@tnsp.org>
parents: 33
diff changeset
92 sdl-win64:
678924af9149 Buildsystem changes, build zaxplay or orig only when the target probably allows it.
Matti Hamalainen <ccr@tnsp.org>
parents: 33
diff changeset
93 $(RM) config.mak && \
71
a87eb778f225 Improvements to the MinGW crossbuild. Should now build with default tools
Matti Hamalainen <ccr@tnsp.org>
parents: 66
diff changeset
94 $(MAKE) config.mak PREFIX="$(MINGW64_PREFIX)" BINEXT=".exe" CC="gcc" \
38
678924af9149 Buildsystem changes, build zaxplay or orig only when the target probably allows it.
Matti Hamalainen <ccr@tnsp.org>
parents: 33
diff changeset
95 XTARGET="$@" XCFLAGS="-DDRIVE_SDL `$(MINGW64_PATH)/bin/sdl-config --cflags`" \
85
011e65a6367b Fix build again.
Matti Hamalainen <ccr@tnsp.org>
parents: 84
diff changeset
96 XLDFLAGS="-s -L$(MINGW64_PATH)/lib/ -lm -lmingw32 `$(MINGW64_PATH)/bin/sdl-config --libs` -lSDL" && \
23
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
97 $(MAKE) all
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
98
66
1bd4e39c600b Bump version.
Matti Hamalainen <ccr@tnsp.org>
parents: 49
diff changeset
99 PACKAGE=pwpunix-1.96-sdl
47
b556bdc2a365 Add 'hg-tar' target for making a tarball from the Mercurial repository.
Matti Hamalainen <ccr@tnsp.org>
parents: 46
diff changeset
100 ZIPFILE=$(PACKAGE)-win32-bin.zip
46
1a01445cc0a7 Improve the zip packaging a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 45
diff changeset
101
45
728a691ffe65 "Hidden" targets for win32 binary zip generation.
Matti Hamalainen <ccr@tnsp.org>
parents: 38
diff changeset
102 README.txt: README
728a691ffe65 "Hidden" targets for win32 binary zip generation.
Matti Hamalainen <ccr@tnsp.org>
parents: 38
diff changeset
103 unix2dos -n $< $@
728a691ffe65 "Hidden" targets for win32 binary zip generation.
Matti Hamalainen <ccr@tnsp.org>
parents: 38
diff changeset
104
728a691ffe65 "Hidden" targets for win32 binary zip generation.
Matti Hamalainen <ccr@tnsp.org>
parents: 38
diff changeset
105 sdl-win32-zip: clean sdl-win32 README.txt SDL.dll
46
1a01445cc0a7 Improve the zip packaging a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 45
diff changeset
106 $(RM) $(ZIPFILE)
45
728a691ffe65 "Hidden" targets for win32 binary zip generation.
Matti Hamalainen <ccr@tnsp.org>
parents: 38
diff changeset
107 for subdir in $(SUBDIRS); do tmp=`ls $$subdir/*.exe`; if test -f "$$tmp"; then cp "$$tmp" .; fi; done; \
46
1a01445cc0a7 Improve the zip packaging a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 45
diff changeset
108 zip -9vv $(ZIPFILE) *.exe README.txt SDL.dll
47
b556bdc2a365 Add 'hg-tar' target for making a tarball from the Mercurial repository.
Matti Hamalainen <ccr@tnsp.org>
parents: 46
diff changeset
109
b556bdc2a365 Add 'hg-tar' target for making a tarball from the Mercurial repository.
Matti Hamalainen <ccr@tnsp.org>
parents: 46
diff changeset
110 hg-tar:
b556bdc2a365 Add 'hg-tar' target for making a tarball from the Mercurial repository.
Matti Hamalainen <ccr@tnsp.org>
parents: 46
diff changeset
111 hg archive -t tgz $(PACKAGE).tar.gz
b556bdc2a365 Add 'hg-tar' target for making a tarball from the Mercurial repository.
Matti Hamalainen <ccr@tnsp.org>
parents: 46
diff changeset
112
23
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
113 .dummy:
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
114