annotate Makefile @ 24:78235ee17b69

Cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 23 May 2010 23:01:27 +0300
parents c3622b53a23e
children 8b2b0677eb99
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
24
78235ee17b69 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 23
diff changeset
2 CFLAGS += -g -W -Wall -O3
78235ee17b69 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 23
diff changeset
3 LDFLAGS +=
23
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
4
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
5 ### Subdirectories to build
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
6 SUBDIRS=pwplib peluce nykyaeka oldchsool pwpzax
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
7
23
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
8 ### Show some help
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
9 help:
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
10 @if test ! -f config.mak; then \
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
11 echo "PWPLib build system"; \
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
12 echo "Usage: make <target>"; \
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
13 echo ""; \
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
14 echo "sdl - LibSDL video/audio for POSIX style systems"; \
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
15 echo "unix - Terminal only POSIX style systems"; \
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
16 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
17 echo "hpux - HP-UX (untested now)"; \
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
18 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
19 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
20 echo ""; \
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
21 else \
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
22 echo "Configured as:"; \
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
23 cat config.mak; \
24
78235ee17b69 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 23
diff changeset
24 echo "To re-build: 'make all'"; \
78235ee17b69 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 23
diff changeset
25 echo "To reconfigure: 'make clean' and 'make <target>'"; \
23
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
26 fi
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27
23
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
28 endianchk: endianchk.c
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
29 $(CC) -o $@ $<
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
30
23
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
31 config.mak:
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
32 @echo "" > $@
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
33 @echo "# Build target: $(XTARGET)" >> $@
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
34 @echo "CC=$(CC)" >> $@
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
35 @echo "CFLAGS=$(CFLAGS) $(XCFLAGS)" >> $@
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
36 @echo "LDFLAGS=$(LDFLAGS) $(XLDFLAGS)" >> $@
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
37 @echo "" >> $@
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
38
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
39 ### Build sub targets
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
40 all:
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
41 @for subdir in $(SUBDIRS); do $(MAKE) -C "$$subdir"; done
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
42
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
43 pwplib.a:
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
44 $(MAKE) -C pwplib
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
45
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
46 clean:
23
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
47 @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
48 $(RM) config.mak endianchk
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
49
23
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
50 ### Major targets
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
51 unix: endianchk
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
52 $(RM) config.mak && endianflags=`./endianchk` && \
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
53 $(MAKE) config.mak XTARGET="$@" XCFLAGS="-DUNIX $$endianflags" XLDFLAGS="-lm" && \
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
54 $(MAKE) all
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
55
23
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
56 hpux:
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
57 $(RM) config.mak && \
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
58 $(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
59 $(MAKE) all
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
60
23
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
61 linux: endianchk
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
62 $(RM) config.mak && endianflags=`./endianchk` && \
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
63 $(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
64 $(MAKE) all
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
65
23
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
66 sdl: endianchk
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
67 $(RM) config.mak && endianflags=`./endianchk` && \
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
68 $(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
69 $(MAKE) all
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
70
23
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
71 sdl-win32: endianchk
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
72 $(RM) config.mak && \
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
73 $(MAKE) config.mak CC=i586-mingw32msvc-gcc AR=i586-mingw32msvc-ar \
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
74 XTARGET="$@" XCFLAGS="-DUNIX -DDRIVE_SDL `sdl-config --cflags`" XLDFLAGS="`sdl-config --libs`" && \
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
75 $(MAKE) all
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
76
23
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
77 .dummy:
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
78