upgraded both QuakeC VMs to use a table of negative string indices for all dynamic...
[divverent/darkplaces.git] / makefile
1 #####  DP_MAKE_TARGET autodetection and arch specific variables ##### 
2
3 ifndef DP_MAKE_TARGET
4
5 # Win32
6 ifdef windir
7         DP_MAKE_TARGET=mingw
8 else
9
10 # UNIXes
11 DP_ARCH:=$(shell uname)
12 ifneq ($(filter %BSD,$(DP_ARCH)),)
13         DP_MAKE_TARGET=bsd
14 else
15 ifeq ($(DP_ARCH), Darwin)
16         DP_MAKE_TARGET=macosx
17 else
18         DP_MAKE_TARGET=linux
19
20 endif  # ifeq ($(DP_ARCH), Darwin)
21 endif  # ifneq ($(filter %BSD,$(DP_ARCH)),)
22 endif  # ifdef windir
23 endif  # ifndef DP_MAKE_TARGET
24
25 # If we're not on compiling for Win32, we need additional information
26 ifneq ($(DP_MAKE_TARGET), mingw)
27         DP_ARCH:=$(shell uname)
28         DP_MACHINE:=$(shell uname -m)
29 endif
30
31
32 # Command used to delete files
33 ifdef windir
34         CMD_RM=del
35 else
36         CMD_RM=$(CMD_UNIXRM)
37 endif
38
39 # 64bits AMD CPUs use another lib directory
40 ifeq ($(DP_MACHINE),x86_64)
41         UNIX_X11LIBPATH:=-L/usr/X11R6/lib64
42 else
43         UNIX_X11LIBPATH:=-L/usr/X11R6/lib
44 endif
45
46
47 # Linux configuration
48 ifeq ($(DP_MAKE_TARGET), linux)
49         OBJ_SOUND=$(OBJ_LINUXSOUND)
50         LIB_SOUND=$(LIB_LINUXSOUND)
51         OBJ_CD=$(OBJ_LINUXCD)
52
53         OBJ_CL=$(OBJ_GLX)
54
55         LDFLAGS_CL=$(LDFLAGS_LINUXCL)
56         LDFLAGS_SV=$(LDFLAGS_LINUXSV)
57         LDFLAGS_SDL=$(LDFLAGS_LINUXSDL)
58
59         EXE_CL=$(EXE_UNIXCL)
60         EXE_SV=$(EXE_UNIXSV)
61         EXE_SDL=$(EXE_UNIXSDL)
62 endif
63
64 # Mac OS X configuration
65 ifeq ($(DP_MAKE_TARGET), macosx)
66         OBJ_SOUND=$(OBJ_MACOSXSOUND)
67         LIB_SOUND=$(LIB_MACOSXSOUND)
68         OBJ_CD=$(OBJ_MACOSXCD)
69
70         OBJ_CL=$(OBJ_AGL)
71
72         LDFLAGS_CL=$(LDFLAGS_MACOSXCL)
73         LDFLAGS_SV=$(LDFLAGS_MACOSXSV)
74         LDFLAGS_SDL=$(LDFLAGS_MACOSXSDL)
75
76         EXE_CL=$(EXE_UNIXCL)
77         EXE_SV=$(EXE_UNIXSV)
78         EXE_SDL=$(EXE_UNIXSDL)
79 endif
80
81 # BSD configuration
82 ifeq ($(DP_MAKE_TARGET), bsd)
83 ifeq ($(DP_ARCH),FreeBSD)
84         OBJ_SOUND=$(OBJ_OSSSOUND)
85         LIB_SOUND=$(LIB_OSSSOUND)
86 else
87         OBJ_SOUND=$(OBJ_BSDSOUND)
88         LIB_SOUND=$(LIB_BSDSOUND)
89 endif
90         OBJ_CD=$(OBJ_BSDCD)
91
92         OBJ_CL=$(OBJ_GLX)
93
94         LDFLAGS_CL=$(LDFLAGS_BSDCL)
95         LDFLAGS_SV=$(LDFLAGS_BSDSV)
96         LDFLAGS_SDL=$(LDFLAGS_BSDSDL)
97
98         EXE_CL=$(EXE_UNIXCL)
99         EXE_SV=$(EXE_UNIXSV)
100         EXE_SDL=$(EXE_UNIXSDL)
101 endif
102
103 # Win32 configuration
104 ifeq ($(DP_MAKE_TARGET), mingw)
105         OBJ_SOUND=$(OBJ_WINSOUND)
106         LIB_SOUND=$(LIB_WINSOUND)
107         OBJ_CD=$(OBJ_WINCD)
108
109         OBJ_CL=$(OBJ_WGL)
110
111         LDFLAGS_CL=$(LDFLAGS_WINCL)
112         LDFLAGS_SV=$(LDFLAGS_WINSV)
113         LDFLAGS_SDL=$(LDFLAGS_WINSDL)
114
115         EXE_CL=$(EXE_WINCL)
116         EXE_SV=$(EXE_WINSV)
117         EXE_SDL=$(EXE_WINSDL)
118 endif
119
120
121 ##### GNU Make specific definitions #####
122
123 DO_LD=$(CC) -o $@ $^ $(LDFLAGS)
124
125
126 ##### Definitions shared by all makefiles #####
127 include makefile.inc
128
129
130 ##### Dependency files #####
131
132 -include *.d