4edb1937dfeaf2f63ef28d01bb7b38493efe5b99
[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
24 XPM_INCLUDE_FILE = -DXPM_INCLUDE_FILE="<X11/xpm.h>"
25
26 CONFIG = $(GAME_DIR) $(SOUNDS) $(JOYSTICK)      \
27          $(SCORE_ENTRIES) $(XPM_INCLUDE_FILE)
28
29 # DEBUG = -DDEBUG -g -ansi -pedantic -Wall
30 DEBUG = -DDEBUG -g -Wall
31 # DEBUG = -O6
32
33 # SYSTEM = -Aa -D_HPUX_SOURCE -Dhpux    # for HP-UX (obsolete)
34 # SYSTEM = -DSYSV -Ae                   # for HP-UX
35 # INCL = -I/usr/include/X11R5           # for HP-UX and others
36 # INCL = -I/usr/local/X11/include       # for SunOS and others
37 # LIBS = -L/usr/lib/X11R5 -lXpm -lX11 -lm
38 #                                       # for HP-UX and others
39 # LIBS = -L/usr/local/X11/lib -lXpm -lX11 -lm -lsocket -R/usr/local/X11/lib
40 #                                       # for SunOS and others
41
42 LIBS = -L/usr/X11R6/lib -lXpm -lX11 -lm
43 # LIBS = -L/usr/X11R6/lib -lX11 -lm
44
45 # CFLAGS = -O2 $(CONFIG) $(SYSTEM)
46 CFLAGS = $(DEBUG) $(CONFIG) $(SYSTEM) $(INCL)
47
48 SRCS =  main.c          \
49         init.c          \
50         events.c        \
51         tools.c         \
52         screens.c       \
53         misc.c          \
54         game.c          \
55         editor.c        \
56         buttons.c       \
57         files.c         \
58         tape.c          \
59         sound.c         \
60         joystick.c      \
61         cartoons.c      \
62         gfxload.c       \
63         gifload.c       \
64         gif.c           \
65         send.c          \
66         new.c           \
67         random.c
68
69 OBJS =  main.o          \
70         init.o          \
71         events.o        \
72         tools.o         \
73         screens.o       \
74         misc.o          \
75         game.o          \
76         editor.o        \
77         buttons.o       \
78         files.o         \
79         tape.o          \
80         sound.o         \
81         joystick.o      \
82         cartoons.o      \
83         gfxload.o       \
84         gifload.o       \
85         gif.o           \
86         send.o          \
87         new.o           \
88         random.o
89
90 all:    $(OBJS)
91         $(CC) $(CFLAGS) $(OBJS) $(LIBS) -o $(PROGNAME)
92
93 .c.o:
94         $(CC) $(CFLAGS) -c $*.c
95
96 clean:
97         $(RM) $(OBJS)
98
99 BACKUP_DIR = /home/aeglos/BACKUP/rnd
100 BACKUP_DATE = `date +%y%m%d`
101 BACKUP_FILE = $(BACKUP_DIR)/rnd-$(BACKUP_DATE).tgz
102
103 backup:
104         @echo "tar cvzf $(BACKUP_FILE) *.c *.h Makefile"
105         @tar cvzf $(BACKUP_FILE) *.c *.h Makefile
106
107 depend:
108         for i in $(SRCS); do $(CPP) $(CFLAGS) -M $$i; done > .depend
109
110 ifeq (.depend,$(wildcard .depend))
111 include .depend
112 endif