rnd-19980930-1
[rocksndiamonds.git] / src / Makefile
1 #
2 # Makefile fuer "Rocks'n'Diamonds -- McDuffin Strikes Back"
3 #
4
5 PROGNAME = rocksndiamonds
6 SERVNAME = rnd_server
7
8 RM = rm -f
9 CC = gcc
10 CPP = $(CC) -E
11 # CC = cc                               # for HP-UX and others
12
13 GAME_DIR = -DGAME_DIR=\".\"             # path of the game and its data
14 # JOYSTICK = -DNO_JOYSTICK              # no joystick
15 # SOUNDS = -DNO_SOUNDS                  # no sounds
16 # SCORE_ENTRIES = -DONE_PER_NAME        # only one score entry per name
17 SCORE_ENTRIES = -DMANY_PER_NAME         # many score entries per name
18
19 # The XPM-Library is no longer needed to build this program,
20 # but is used to load graphics if XPM_INCLUDE_FILE is defined,
21 # because the GIF loading routines are still a bit beta.
22 # If you use the Xpm library, convert the GIF files to Xpm
23 # files (and the mask files ('*Maske.gif') to xbm files).
24
25 # XPM_INCLUDE_FILE = -DXPM_INCLUDE_FILE="<X11/xpm.h>"
26
27 CONFIG = $(GAME_DIR) $(SOUNDS) $(JOYSTICK)      \
28          $(SCORE_ENTRIES) $(XPM_INCLUDE_FILE)
29
30 # DEBUG = -DDEBUG -g -ansi -pedantic -Wall
31 DEBUG = -DDEBUG -g -Wall
32 # DEBUG = -O6
33
34 # SYSTEM = -Aa -D_HPUX_SOURCE -Dhpux    # for HP-UX (obsolete)
35 # SYSTEM = -DSYSV -Ae                   # for HP-UX
36 # INCL = -I/usr/include/X11R5           # for HP-UX and others
37 # INCL = -I/usr/local/X11/include       # for SunOS and others
38 # LIBS = -L/usr/lib/X11R5 -lXpm -lX11 -lm
39 #                                       # for HP-UX and others
40 # LIBS = -L/usr/local/X11/lib -lXpm -lX11 -lm -lsocket -R/usr/local/X11/lib
41 #                                       # for SunOS and others
42
43 # LIBS = -L/usr/X11R6/lib -lXpm -lX11 -lm
44 LIBS = -L/usr/X11R6/lib -lX11 -lm
45
46 # CFLAGS = -O2 $(CONFIG) $(SYSTEM)
47 CFLAGS = $(DEBUG) $(CONFIG) $(SYSTEM) $(INCL)
48
49 SRCS =  main.c          \
50         init.c          \
51         events.c        \
52         tools.c         \
53         screens.c       \
54         misc.c          \
55         game.c          \
56         editor.c        \
57         buttons.c       \
58         files.c         \
59         tape.c          \
60         sound.c         \
61         joystick.c      \
62         cartoons.c      \
63         gfxload.c       \
64         gifload.c       \
65         gif.c           \
66         send.c          \
67         new.c           \
68         random.c
69
70 OBJS =  main.o          \
71         init.o          \
72         events.o        \
73         tools.o         \
74         screens.o       \
75         misc.o          \
76         game.o          \
77         editor.o        \
78         buttons.o       \
79         files.o         \
80         tape.o          \
81         sound.o         \
82         joystick.o      \
83         cartoons.o      \
84         gfxload.o       \
85         gifload.o       \
86         gif.o           \
87         send.o          \
88         new.o           \
89         random.o
90
91 all:    $(PROGNAME) $(SERVNAME)
92
93 $(PROGNAME):    $(OBJS)
94         $(CC) $(CFLAGS) $(OBJS) $(LIBS) -o $(PROGNAME)
95
96 $(SERVNAME):    $(SERVNAME).c
97         $(CC) $(CFLAGS) $(SERVNAME).c $(LIBS) -o $(SERVNAME)
98
99 .c.o:
100         $(CC) $(CFLAGS) -c $*.c
101
102 clean:
103         $(RM) $(OBJS)
104
105 backup:
106         ./make_backup.sh
107
108 depend:
109         for i in $(SRCS); do $(CPP) $(CFLAGS) -M $$i; done > .depend
110
111 ifeq (.depend,$(wildcard .depend))
112 include .depend
113 endif