1#-----------------------------------------------------------------------------#
2# ROTT makefile.
3#-----------------------------------------------------------------------------#
4
5
6#-----------------------------------------------------------------------------#
7# If this makefile fails to detect Cygwin correctly, or you want to force
8#  the build process's behaviour, set it to "true" or "false" (w/o quotes).
9#-----------------------------------------------------------------------------#
10#cygwin := true
11cygwin := false
12#cygwin := autodetect
13
14# you only need to set these for Cygwin at the moment.
15SDL_INC_DIR = /cygdrive/c/SDL/include
16SDL_LIB_DIR = /cygdrive/c/SDL/lib
17
18
19# Don't touch anything below this line unless you know what you're doing.
20
21ifeq ($(strip $(cygwin)),autodetect)
22  ifneq ($(strip $(shell gcc -v 2>&1 |grep "cygwin")),)
23    cygwin := true
24  else
25    cygwin := false
26  endif
27endif
28
29
30ifeq ($(strip $(cygwin)),true)
31  ifeq ($(strip $(SDL_INC_DIR)),please_set_me_cygwin_users)
32    $(error Cygwin users need to set the SDL_INC_DIR envr var.)
33  else
34    SDL_CFLAGS := -I$(SDL_INC_DIR)
35  endif
36
37  ifeq ($(strip $(SDL_LIB_DIR)),please_set_me_cygwin_users)
38    $(error Cygwin users need to set the SDL_LIB_DIR envr var.)
39  else
40    SDL_LDFLAGS := -L$(SDL_LIB_DIR) -lSDL
41  endif
42else
43  SDL_CFLAGS := $(shell ${SDL_CONFIG} --cflags)
44  SDL_LDFLAGS := $(shell ${SDL_CONFIG} --libs)
45#  EXTRACFLAGS += -DUSE_EXECINFO=1
46endif
47
48
49#CC = gcc
50CFLAGS += -g $(SDL_CFLAGS) -DUSE_SDL=1 -DPLATFORM_UNIX=1 -W -Wall -Wno-unused $(EXTRACFLAGS)
51LDLIBS = $(SDL_LDFLAGS) -lSDL_mixer $(EXTRALDFLAGS) -Wl,-E
52
53all: rott
54
55rott: 	\
56	cin_actr.o \
57	cin_efct.o \
58	cin_evnt.o \
59	cin_glob.o \
60	cin_main.o \
61	cin_util.o \
62	dosutil.o \
63	engine.o \
64	fx_man.o \
65	isr.o \
66	modexlib.o \
67	rt_actor.o \
68	rt_battl.o \
69	rt_build.o \
70	rt_cfg.o \
71	rt_crc.o \
72	rt_com.o \
73	rt_debug.o \
74	rt_dmand.o \
75	rt_door.o \
76	rt_draw.o \
77	rt_floor.o \
78	rt_game.o \
79	rt_in.o \
80	rt_main.o \
81	rt_map.o \
82	rt_menu.o \
83	rt_msg.o \
84	rt_net.o \
85	rt_playr.o \
86	rt_rand.o \
87	rt_scale.o \
88	rt_sound.o \
89	rt_spbal.o \
90	rt_sqrt.o \
91	rt_stat.o \
92	rt_state.o \
93	rt_str.o \
94	rt_swift.o \
95	rt_ted.o \
96	rt_util.o \
97	rt_view.o \
98	rt_vid.o \
99	rt_err.o \
100	scriplib.o \
101	w_wad.o \
102	watcom.o \
103	z_zone.o \
104	byteordr.o
105	$(CC) $^ $(LDLIBS) -o $@
106
107clean:
108	rm -rf *.o
109
110distclean: clean
111	rm -rf *~
112