now compiles on x86_64 successfully (still a crash regarding progs strings to fix...
[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 ifeq ($(DP_ARCH),NetBSD)
13         DP_MAKE_TARGET=bsd
14 else
15         DP_MAKE_TARGET=linux
16 endif
17
18 endif
19
20 endif
21
22
23 # Command used to delete files
24 ifdef windir
25         CMD_RM=del
26 else
27         CMD_RM=$(CMD_UNIXRM)
28 endif
29
30
31 DP_MACHINE:=$(shell uname -m)
32 ifeq ($(DP_MACHINE),x86_64)
33         UNIX_X11LIBPATH:=-L/usr/X11R6/lib64
34 else
35         UNIX_X11LIBPATH:=-L/usr/X11R6/lib
36 endif
37
38
39 # Linux configuration
40 ifeq ($(DP_MAKE_TARGET), linux)
41         OBJ_SOUND=$(OBJ_LINUXSOUND)
42         LIB_SOUND=$(LIB_LINUXSOUND)
43         OBJ_CD=$(OBJ_LINUXCD)
44
45         OBJ_CL=$(OBJ_GLX)
46
47         LDFLAGS_CL=$(LDFLAGS_LINUXCL)
48         LDFLAGS_SV=$(LDFLAGS_LINUXSV)
49         LDFLAGS_SDL=$(LDFLAGS_LINUXSDL)
50
51         EXE_CL=$(EXE_UNIXCL)
52         EXE_SV=$(EXE_UNIXSV)
53         EXE_SDL=$(EXE_UNIXSDL)
54 endif
55
56 # BSD configuration
57 ifeq ($(DP_MAKE_TARGET), bsd)
58         OBJ_SOUND=$(OBJ_BSDSOUND)
59         LIB_SOUND=$(LIB_BSDSOUND)
60         OBJ_CD=$(OBJ_BSDCD)
61
62         OBJ_CL=$(OBJ_GLX)
63
64         LDFLAGS_CL=$(LDFLAGS_BSDCL)
65         LDFLAGS_SV=$(LDFLAGS_BSDSV)
66         LDFLAGS_SDL=$(LDFLAGS_BSDSDL)
67
68         EXE_CL=$(EXE_UNIXCL)
69         EXE_SV=$(EXE_UNIXSV)
70         EXE_SDL=$(EXE_UNIXSDL)
71 endif
72
73 # Win32 configuration
74 ifeq ($(DP_MAKE_TARGET), mingw)
75         OBJ_SOUND=$(OBJ_WINSOUND)
76         LIB_SOUND=$(LIB_WINSOUND)
77         OBJ_CD=$(OBJ_WINCD)
78
79         OBJ_CL=$(OBJ_WGL)
80
81         LDFLAGS_CL=$(LDFLAGS_WINCL)
82         LDFLAGS_SV=$(LDFLAGS_WINSV)
83         LDFLAGS_SDL=$(LDFLAGS_WINSDL)
84
85         EXE_CL=$(EXE_WINCL)
86         EXE_SV=$(EXE_WINSV)
87         EXE_SDL=$(EXE_WINSDL)
88 endif
89
90
91 ##### GNU Make specific definitions #####
92
93 DO_LD=$(CC) -o $@ $^ $(LDFLAGS)
94
95
96 ##### Definitions shared by all makefiles #####
97 include makefile.inc
98
99
100 ##### Dependency files #####
101
102 -include *.d