Mercurial > hg > forks > pwpunix
annotate Makefile @ 64:c272f66c5eb8
Add pwplib_end() to public header.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 06 Aug 2011 10:41:08 +0300 |
parents | 4698627de33d |
children | 1bd4e39c600b |
rev | line source |
---|---|
23 | 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 | 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 |
38
678924af9149
Buildsystem changes, build zaxplay or orig only when the target probably allows it.
Matti Hamalainen <ccr@tnsp.org>
parents:
33
diff
changeset
|
6 MINGW32_PATH=/usr/local/i386-mingw32 |
678924af9149
Buildsystem changes, build zaxplay or orig only when the target probably allows it.
Matti Hamalainen <ccr@tnsp.org>
parents:
33
diff
changeset
|
7 MINGW64_PATH=/foo/bar |
23 | 8 |
9 ### Subdirectories to build | |
10 SUBDIRS=pwplib peluce nykyaeka oldchsool pwpzax | |
0 | 11 |
23 | 12 ### Show some help |
13 help: | |
14 @if test ! -f config.mak; then \ | |
15 echo "PWPLib build system"; \ | |
16 echo "Usage: make <target>"; \ | |
17 echo ""; \ | |
18 echo "sdl - LibSDL video/audio for POSIX style systems"; \ | |
19 echo "unix - Terminal only POSIX style systems"; \ | |
20 echo "linux - Like unix, but with Linux console and OSS audio support"; \ | |
21 echo "hpux - HP-UX (untested now)"; \ | |
22 echo "sdl-win32 - LibSDL for Win32, cross compilation via MinGW toolchain"; \ | |
23 echo "sdl-win64 - Like above, but for Win64 via MinGW64"; \ | |
24 echo ""; \ | |
25 else \ | |
26 echo "Configured as:"; \ | |
27 cat config.mak; \ | |
24 | 28 echo "To re-build: 'make all'"; \ |
29 echo "To reconfigure: 'make clean' and 'make <target>'"; \ | |
23 | 30 fi |
0 | 31 |
23 | 32 endianchk: endianchk.c |
33 $(CC) -o $@ $< | |
0 | 34 |
23 | 35 config.mak: |
36 @echo "" > $@ | |
37 @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
|
38 @echo "XTARGET=$(XTARGET)" >> $@ |
33
8b2b0677eb99
Build system changes for SDL/Win32 cross-build via MinGW hosted on Linux.
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
39 @echo "PATH=$(PATH)" >> $@ |
23 | 40 @echo "CC=$(CC)" >> $@ |
33
8b2b0677eb99
Build system changes for SDL/Win32 cross-build via MinGW hosted on Linux.
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
41 @echo "AR=$(AR)" >> $@ |
8b2b0677eb99
Build system changes for SDL/Win32 cross-build via MinGW hosted on Linux.
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
42 @echo "LD=$(LD)" >> $@ |
49
4698627de33d
Use ranlib when building pwplib.a.
Matti Hamalainen <ccr@tnsp.org>
parents:
47
diff
changeset
|
43 @echo "RANLIB=$(RANLIB)" >> $@ |
23 | 44 @echo "CFLAGS=$(CFLAGS) $(XCFLAGS)" >> $@ |
45 @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
|
46 @echo "BINEXT=$(BINEXT)" >> $@ |
23 | 47 @echo "" >> $@ |
48 | |
49 ### Build sub targets | |
50 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
|
51 @for subdir in $(SUBDIRS); do if ! $(MAKE) -C "$$subdir"; then echo "Make returned $?"; exit 1; fi; done |
23 | 52 |
53 pwplib.a: | |
54 $(MAKE) -C pwplib | |
0 | 55 |
56 clean: | |
23 | 57 @for subdir in $(SUBDIRS); do $(MAKE) -C "$$subdir" clean; done |
58 $(RM) config.mak endianchk | |
0 | 59 |
23 | 60 ### Major targets |
61 unix: endianchk | |
62 $(RM) config.mak && endianflags=`./endianchk` && \ | |
63 $(MAKE) config.mak XTARGET="$@" XCFLAGS="-DUNIX $$endianflags" XLDFLAGS="-lm" && \ | |
64 $(MAKE) all | |
0 | 65 |
23 | 66 hpux: |
67 $(RM) config.mak && \ | |
68 $(MAKE) config.mak XTARGET="$@" XCFLAGS="-DUNIX -DBIG_ENDIAN -DDRIVE_HPUX" XLDFLAGS="-lm" && \ | |
69 $(MAKE) all | |
0 | 70 |
23 | 71 linux: endianchk |
72 $(RM) config.mak && endianflags=`./endianchk` && \ | |
73 $(MAKE) config.mak XTARGET="$@" XCFLAGS="-DUNIX -DDRIVE_LINUXCON -DDRIVE_OSS $$endianflags" XLDFLAGS="-lm" && \ | |
74 $(MAKE) all | |
0 | 75 |
23 | 76 sdl: endianchk |
77 $(RM) config.mak && endianflags=`./endianchk` && \ | |
78 $(MAKE) config.mak XTARGET="$@" XCFLAGS="-DUNIX -DDRIVE_SDL $$endianflags `sdl-config --cflags`" XLDFLAGS="`sdl-config --libs` -lm" && \ | |
79 $(MAKE) all | |
0 | 80 |
38
678924af9149
Buildsystem changes, build zaxplay or orig only when the target probably allows it.
Matti Hamalainen <ccr@tnsp.org>
parents:
33
diff
changeset
|
81 sdl-win32: |
23 | 82 $(RM) config.mak && \ |
38
678924af9149
Buildsystem changes, build zaxplay or orig only when the target probably allows it.
Matti Hamalainen <ccr@tnsp.org>
parents:
33
diff
changeset
|
83 $(MAKE) config.mak PATH="$(MINGW32_PATH)/bin:/usr/bin:/bin" BINEXT=".exe" CC="gcc" \ |
678924af9149
Buildsystem changes, build zaxplay or orig only when the target probably allows it.
Matti Hamalainen <ccr@tnsp.org>
parents:
33
diff
changeset
|
84 XTARGET="$@" XCFLAGS="-DDRIVE_SDL `$(MINGW32_PATH)/bin/sdl-config --cflags`" \ |
678924af9149
Buildsystem changes, build zaxplay or orig only when the target probably allows it.
Matti Hamalainen <ccr@tnsp.org>
parents:
33
diff
changeset
|
85 XLDFLAGS="-s -L$(MINGW32_PATH)/lib/ `$(MINGW32_PATH)/bin/sdl-config --libs` -lwinmm" && \ |
678924af9149
Buildsystem changes, build zaxplay or orig only when the target probably allows it.
Matti Hamalainen <ccr@tnsp.org>
parents:
33
diff
changeset
|
86 $(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
|
87 |
678924af9149
Buildsystem changes, build zaxplay or orig only when the target probably allows it.
Matti Hamalainen <ccr@tnsp.org>
parents:
33
diff
changeset
|
88 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
|
89 $(RM) config.mak && \ |
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) config.mak PATH="$(MINGW64_PATH)/bin:/usr/bin:/bin" BINEXT=".exe" CC="gcc" \ |
678924af9149
Buildsystem changes, build zaxplay or orig only when the target probably allows it.
Matti Hamalainen <ccr@tnsp.org>
parents:
33
diff
changeset
|
91 XTARGET="$@" XCFLAGS="-DDRIVE_SDL `$(MINGW64_PATH)/bin/sdl-config --cflags`" \ |
678924af9149
Buildsystem changes, build zaxplay or orig only when the target probably allows it.
Matti Hamalainen <ccr@tnsp.org>
parents:
33
diff
changeset
|
92 XLDFLAGS="-s -L$(MINGW64_PATH)/lib/ `$(MINGW64_PATH)/bin/sdl-config --libs` -lwinmm" && \ |
23 | 93 $(MAKE) all |
0 | 94 |
47
b556bdc2a365
Add 'hg-tar' target for making a tarball from the Mercurial repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
46
diff
changeset
|
95 PACKAGE=pwpunix-1.95-sdl |
b556bdc2a365
Add 'hg-tar' target for making a tarball from the Mercurial repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
46
diff
changeset
|
96 ZIPFILE=$(PACKAGE)-win32-bin.zip |
46
1a01445cc0a7
Improve the zip packaging a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
45
diff
changeset
|
97 |
45
728a691ffe65
"Hidden" targets for win32 binary zip generation.
Matti Hamalainen <ccr@tnsp.org>
parents:
38
diff
changeset
|
98 README.txt: README |
728a691ffe65
"Hidden" targets for win32 binary zip generation.
Matti Hamalainen <ccr@tnsp.org>
parents:
38
diff
changeset
|
99 unix2dos -n $< $@ |
728a691ffe65
"Hidden" targets for win32 binary zip generation.
Matti Hamalainen <ccr@tnsp.org>
parents:
38
diff
changeset
|
100 |
728a691ffe65
"Hidden" targets for win32 binary zip generation.
Matti Hamalainen <ccr@tnsp.org>
parents:
38
diff
changeset
|
101 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
|
102 $(RM) $(ZIPFILE) |
45
728a691ffe65
"Hidden" targets for win32 binary zip generation.
Matti Hamalainen <ccr@tnsp.org>
parents:
38
diff
changeset
|
103 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
|
104 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
|
105 |
b556bdc2a365
Add 'hg-tar' target for making a tarball from the Mercurial repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
46
diff
changeset
|
106 hg-tar: |
b556bdc2a365
Add 'hg-tar' target for making a tarball from the Mercurial repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
46
diff
changeset
|
107 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
|
108 |
23 | 109 .dummy: |
110 |