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