rocksndiamonds-1.2.0
[rocksndiamonds.git] / src / Makefile
1 #=============================================================================#
2 # Makefile for Rocks'n'Diamonds 1.2                                           #
3 # (c) 1995-98 Holger Schemel, aeglos@valinor.owl.de                           #
4 #=============================================================================#
5
6 ifndef PLATFORM                 # platform not defined -- try auto detection
7 ifdef COMSPEC
8 PLATFORM = dos
9 else
10 PLATFORM = unix
11 endif
12 endif
13
14 ifdef X11_PATH                  # path to X11 specified by top level Makefile
15 XINC_PATH = $(X11_PATH)/include
16 XLIB_PATH = $(X11_PATH)/lib
17 X11_INCL = -I$(XINC_PATH)
18 X11_LIBS = -L$(XLIB_PATH)
19 endif
20
21 ifndef GAME_DIR                 # path to game data not defined -- try '.'
22 GAME_DIR = .
23 endif
24
25 ifndef SCORE_ENTRIES            # number of score entries per player undefined
26 SCORE_ENTRIES = MANY_PER_NAME
27 endif
28
29
30 # The Xpm library is no longer needed to build this program,
31 # but is used to load graphics if XPM_INCLUDE_FILE is defined.
32 # If you want to use the Xpm library, convert the PCX files to XPM
33 # files (and you need corresponding mask files in X11 Bitmap format).
34
35 # XPM_INCLUDE_FILE = -DXPM_INCLUDE_FILE="<X11/xpm.h>"
36 # EXTRA_X11_LIBS = -lXpm
37
38
39 ifeq ($(PLATFORM),dos)          # DOS / Windows
40
41 RM = del
42 PROGNAME = ..\rocks.exe
43 LIBS = -lm -lalleg
44
45 else                            # Unix
46
47 RM = rm -f
48 PROGNAME = ../rocksndiamonds
49
50 ifeq ($(PLATFORM),solaris)
51 EXTRA_LIBS = -lnsl -lsocket -R$(XLIB_PATH)
52 endif
53
54 INCL = $(X11_INCL)
55 LIBS = $(X11_LIBS) $(EXTRA_X11_LIBS) -lX11 -lm $(EXTRA_LIBS)
56
57 endif
58
59
60 CONFIG_GAME_DIR = -DGAME_DIR="\"$(GAME_DIR)\""
61 CONFIG_SCORE_ENTRIES = -D$(SCORE_ENTRIES)
62
63 CONFIG = $(CONFIG_GAME_DIR) $(SOUNDS) $(JOYSTICK)       \
64          $(CONFIG_SCORE_ENTRIES) $(XPM_INCLUDE_FILE)
65
66 # OPTIONS = -DDEBUG -g -Wall    # only for debugging purposes
67 OPTIONS = -O3
68
69 # SYSTEM = -DSYSV -Ae           # maybe needed for HP-UX
70
71 CFLAGS = $(OPTIONS) $(SYSTEM) $(INCL) $(CONFIG)
72
73 SRCS =  main.c          \
74         init.c          \
75         events.c        \
76         tools.c         \
77         screens.c       \
78         misc.c          \
79         game.c          \
80         editor.c        \
81         buttons.c       \
82         files.c         \
83         tape.c          \
84         sound.c         \
85         joystick.c      \
86         cartoons.c      \
87         random.c        \
88         pcx.c           \
89         image.c         \
90         network.c       \
91         netserv.c       \
92         msdos.c
93
94 OBJS =  main.o          \
95         init.o          \
96         events.o        \
97         tools.o         \
98         screens.o       \
99         misc.o          \
100         game.o          \
101         editor.o        \
102         buttons.o       \
103         files.o         \
104         tape.o          \
105         sound.o         \
106         joystick.o      \
107         cartoons.o      \
108         random.o        \
109         pcx.o           \
110         image.o         \
111         network.o       \
112         netserv.o       \
113         msdos.o
114
115 all:    $(PROGNAME)
116
117 $(PROGNAME):    $(OBJS)
118         $(CC) $(CFLAGS) $(OBJS) $(LIBS) -o $(PROGNAME)
119
120 .c.o:
121         $(CC) $(CFLAGS) -c $*.c
122
123 clean:
124         $(RM) *.o
125         $(RM) $(PROGNAME)