Advertisement
Guest User

Untitled

a guest
Jun 27th, 2022
363
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.45 KB | None | 0 0
  1. apples-Mac-mini:buildforapple r00t$
  2. apples-Mac-mini:buildforapple r00t$
  3. apples-Mac-mini:buildforapple r00t$
  4. apples-Mac-mini:buildforapple r00t$ cat darkplaces/makefile
  5. ##### DP_MAKE_TARGET autodetection and arch specific variables #####
  6.  
  7. ifndef DP_MAKE_TARGET
  8.  
  9. # Win32
  10. ifdef WINDIR
  11. DP_MAKE_TARGET=mingw
  12. else
  13.  
  14. # UNIXes
  15. DP_ARCH:=$(shell uname)
  16. ifneq ($(filter %BSD,$(DP_ARCH)),)
  17. DP_MAKE_TARGET=bsd
  18. else
  19. ifeq ($(DP_ARCH), Darwin)
  20. DP_MAKE_TARGET=macosx
  21. else
  22. ifeq ($(DP_ARCH), SunOS)
  23. DP_MAKE_TARGET=sunos
  24. else
  25. DP_MAKE_TARGET=linux
  26.  
  27. endif # ifeq ($(DP_ARCH), SunOS)
  28. endif # ifeq ($(DP_ARCH), Darwin)
  29. endif # ifneq ($(filter %BSD,$(DP_ARCH)),)
  30. endif # ifdef windir
  31. endif # ifndef DP_MAKE_TARGET
  32.  
  33. # If we're not on compiling for Win32, we need additional information
  34. ifneq ($(DP_MAKE_TARGET), mingw)
  35. DP_ARCH:=$(shell uname)
  36. DP_MACHINE:=$(shell uname -m)
  37. endif
  38.  
  39.  
  40. # Command used to delete files
  41. ifdef windir
  42. CMD_RM=del
  43. else
  44. CMD_RM=$(CMD_UNIXRM)
  45. endif
  46.  
  47. # 64bits AMD CPUs use another lib directory
  48. ifeq ($(DP_MACHINE),x86_64)
  49. UNIX_X11LIBPATH:=/usr/X11R6/lib64
  50. else
  51. UNIX_X11LIBPATH:=/usr/X11R6/lib
  52. endif
  53.  
  54. # default targets
  55. TARGETS_DEBUG=sv-debug cl-debug sdl-debug
  56. TARGETS_PROFILE=sv-profile cl-profile sdl-profile
  57. TARGETS_RELEASE=sv-release cl-release sdl-release
  58. TARGETS_RELEASE_PROFILE=sv-release-profile cl-release-profile sdl-release-profile
  59. TARGETS_NEXUIZ=sv-nexuiz cl-nexuiz sdl-nexuiz
  60.  
  61. # Linux configuration
  62. ifeq ($(DP_MAKE_TARGET), linux)
  63. DEFAULT_SNDAPI=ALSA
  64. OBJ_CD=$(OBJ_LINUXCD)
  65.  
  66. OBJ_CL=$(OBJ_GLX)
  67. OBJ_ICON=
  68. OBJ_ICON_NEXUIZ=
  69.  
  70. LDFLAGS_CL=$(LDFLAGS_LINUXCL)
  71. LDFLAGS_SV=$(LDFLAGS_LINUXSV)
  72. LDFLAGS_SDL=$(LDFLAGS_LINUXSDL)
  73.  
  74. SDLCONFIG_CFLAGS=$(SDLCONFIG_UNIXCFLAGS) $(SDLCONFIG_UNIXCFLAGS_X11)
  75. SDLCONFIG_LIBS=$(SDLCONFIG_UNIXLIBS) $(SDLCONFIG_UNIXLIBS_X11)
  76. SDLCONFIG_STATICLIBS=$(SDLCONFIG_UNIXSTATICLIBS) $(SDLCONFIG_UNIXSTATICLIBS_X11)
  77.  
  78. EXE_CL=$(EXE_UNIXCL)
  79. EXE_SV=$(EXE_UNIXSV)
  80. EXE_SDL=$(EXE_UNIXSDL)
  81. EXE_CLNEXUIZ=$(EXE_UNIXCLNEXUIZ)
  82. EXE_SVNEXUIZ=$(EXE_UNIXSVNEXUIZ)
  83. EXE_SDLNEXUIZ=$(EXE_UNIXSDLNEXUIZ)
  84.  
  85. # libjpeg dependency (set these to "" if you want to use dynamic loading instead)
  86. CFLAGS_LIBJPEG=-DLINK_TO_LIBJPEG
  87. LIB_JPEG=-ljpeg
  88. endif
  89.  
  90. # Mac OS X configuration
  91. ifeq ($(DP_MAKE_TARGET), macosx)
  92. DEFAULT_SNDAPI=COREAUDIO
  93. OBJ_CD=$(OBJ_MACOSXCD)
  94.  
  95. OBJ_CL=$(OBJ_AGL)
  96. OBJ_ICON=
  97. OBJ_ICON_NEXUIZ=
  98.  
  99. LDFLAGS_CL=$(LDFLAGS_MACOSXCL)
  100. LDFLAGS_SV=$(LDFLAGS_MACOSXSV)
  101. LDFLAGS_SDL=$(LDFLAGS_MACOSXSDL)
  102.  
  103. SDLCONFIG_CFLAGS=$(SDLCONFIG_MACOSXCFLAGS)
  104. SDLCONFIG_LIBS=$(SDLCONFIG_MACOSXLIBS)
  105. SDLCONFIG_STATICLIBS=$(SDLCONFIG_MACOSXSTATICLIBS)
  106.  
  107. EXE_CL=$(EXE_MACOSXCL)
  108. EXE_SV=$(EXE_UNIXSV)
  109. EXE_SDL=$(EXE_UNIXSDL)
  110. EXE_CLNEXUIZ=$(EXE_MACOSXCLNEXUIZ)
  111. EXE_SVNEXUIZ=$(EXE_UNIXSVNEXUIZ)
  112. EXE_SDLNEXUIZ=$(EXE_UNIXSDLNEXUIZ)
  113.  
  114. ifeq ($(word 2, $(filter -arch, $(CC))), -arch)
  115. CFLAGS_MAKEDEP=
  116. endif
  117.  
  118. # libjpeg dependency (set these to "" if you want to use dynamic loading instead)
  119. # we don't currently link to libjpeg on Mac because the OS does not have an easy way to load libjpeg and we provide our own in the .app
  120. CFLAGS_LIBJPEG=
  121. LIB_JPEG=
  122.  
  123. # on OS X, we don't build the CL by default because it uses deprecated
  124. # and not-implemented-in-64bit Carbon
  125. TARGETS_DEBUG=sv-debug sdl-debug
  126. TARGETS_PROFILE=sv-profile sdl-profile
  127. TARGETS_RELEASE=sv-release sdl-release
  128. TARGETS_RELEASE_PROFILE=sv-release-profile sdl-release-profile
  129. TARGETS_NEXUIZ=sv-nexuiz sdl-nexuiz
  130. endif
  131.  
  132. # SunOS configuration (Solaris)
  133. ifeq ($(DP_MAKE_TARGET), sunos)
  134. DEFAULT_SNDAPI=BSD
  135. OBJ_CD=$(OBJ_SUNOSCD)
  136.  
  137. OBJ_CL=$(OBJ_GLX)
  138. OBJ_ICON=
  139. OBJ_ICON_NEXUIZ=
  140.  
  141. CFLAGS_EXTRA=$(CFLAGS_SUNOS)
  142.  
  143. LDFLAGS_CL=$(LDFLAGS_SUNOSCL)
  144. LDFLAGS_SV=$(LDFLAGS_SUNOSSV)
  145. LDFLAGS_SDL=$(LDFLAGS_SUNOSSDL)
  146.  
  147. SDLCONFIG_CFLAGS=$(SDLCONFIG_UNIXCFLAGS) $(SDLCONFIG_UNIXCFLAGS_X11)
  148. SDLCONFIG_LIBS=$(SDLCONFIG_UNIXLIBS) $(SDLCONFIG_UNIXLIBS_X11)
  149. SDLCONFIG_STATICLIBS=$(SDLCONFIG_UNIXSTATICLIBS) $(SDLCONFIG_UNIXSTATICLIBS_X11)
  150.  
  151. EXE_CL=$(EXE_UNIXCL)
  152. EXE_SV=$(EXE_UNIXSV)
  153. EXE_SDL=$(EXE_UNIXSDL)
  154. EXE_CLNEXUIZ=$(EXE_UNIXCLNEXUIZ)
  155. EXE_SVNEXUIZ=$(EXE_UNIXSVNEXUIZ)
  156. EXE_SDLNEXUIZ=$(EXE_UNIXSDLNEXUIZ)
  157.  
  158. # libjpeg dependency (set these to "" if you want to use dynamic loading instead)
  159. CFLAGS_LIBJPEG=-DLINK_TO_LIBJPEG
  160. LIB_JPEG=-ljpeg
  161. endif
  162.  
  163. # BSD configuration
  164. ifeq ($(DP_MAKE_TARGET), bsd)
  165. ifeq ($(DP_ARCH),FreeBSD)
  166. DEFAULT_SNDAPI=OSS
  167. else
  168. DEFAULT_SNDAPI=BSD
  169. endif
  170. OBJ_CD=$(OBJ_BSDCD)
  171.  
  172. OBJ_CL=$(OBJ_GLX)
  173. OBJ_ICON=
  174. OBJ_ICON_NEXUIZ=
  175.  
  176. LDFLAGS_CL=$(LDFLAGS_BSDCL)
  177. LDFLAGS_SV=$(LDFLAGS_BSDSV)
  178. LDFLAGS_SDL=$(LDFLAGS_BSDSDL)
  179.  
  180. SDLCONFIG_CFLAGS=$(SDLCONFIG_UNIXCFLAGS) $(SDLCONFIG_UNIXCFLAGS_X11)
  181. SDLCONFIG_LIBS=$(SDLCONFIG_UNIXLIBS) $(SDLCONFIG_UNIXLIBS_X11)
  182. SDLCONFIG_STATICLIBS=$(SDLCONFIG_UNIXSTATICLIBS) $(SDLCONFIG_UNIXSTATICLIBS_X11)
  183.  
  184. EXE_CL=$(EXE_UNIXCL)
  185. EXE_SV=$(EXE_UNIXSV)
  186. EXE_SDL=$(EXE_UNIXSDL)
  187. EXE_CLNEXUIZ=$(EXE_UNIXCLNEXUIZ)
  188. EXE_SVNEXUIZ=$(EXE_UNIXSVNEXUIZ)
  189. EXE_SDLNEXUIZ=$(EXE_UNIXSDLNEXUIZ)
  190.  
  191. # libjpeg dependency (set these to "" if you want to use dynamic loading instead)
  192. CFLAGS_LIBJPEG=-DLINK_TO_LIBJPEG
  193. LIB_JPEG=-ljpeg
  194. endif
  195.  
  196. # Win32 configuration
  197. ifeq ($(WIN32RELEASE), 1)
  198. # TARGET=i686-pc-mingw32
  199. # CC=$(TARGET)-g++
  200. # WINDRES=$(TARGET)-windres
  201. CPUOPTIMIZATIONS=-march=i686 -fno-math-errno -ffinite-math-only -fno-rounding-math -fno-signaling-nans -fno-trapping-math
  202. # CPUOPTIMIZATIONS+=-DUSE_WSPIAPI_H -DSUPPORTIPV6
  203. LDFLAGS_WINCOMMON=-Wl,--large-address-aware
  204. else
  205. LDFLAGS_WINCOMMON=
  206. endif
  207.  
  208. ifeq ($(WIN64RELEASE), 1)
  209. # TARGET=x86_64-pc-mingw32
  210. # CC=$(TARGET)-g++
  211. # WINDRES=$(TARGET)-windres
  212. endif
  213.  
  214. ifeq ($(D3D), 1)
  215. CFLAGS_D3D=-DSUPPORTD3D -DSUPPORTDIRECTX
  216. CFLAGS_WARNINGS=-Wall
  217. LDFLAGS_D3D=-ld3d9
  218. else
  219. CFLAGS_D3D=
  220. CFLAGS_WARNINGS=-Wall -Wold-style-definition -Wstrict-prototypes -Wsign-compare -Wdeclaration-after-statement -Wmissing-prototypes
  221. LDFLAGS_D3D=
  222. endif
  223.  
  224.  
  225. ifeq ($(DP_MAKE_TARGET), mingw)
  226. DEFAULT_SNDAPI=WIN
  227. OBJ_CD=$(OBJ_WINCD)
  228.  
  229. OBJ_CL=$(OBJ_WGL)
  230. OBJ_ICON=darkplaces.o
  231. OBJ_ICON_NEXUIZ=nexuiz.o
  232.  
  233. LDFLAGS_CL=$(LDFLAGS_WINCL)
  234. LDFLAGS_SV=$(LDFLAGS_WINSV)
  235. LDFLAGS_SDL=$(LDFLAGS_WINSDL)
  236.  
  237. SDLCONFIG_CFLAGS=$(SDLCONFIG_UNIXCFLAGS)
  238. SDLCONFIG_LIBS=$(SDLCONFIG_UNIXLIBS)
  239. SDLCONFIG_STATICLIBS=$(SDLCONFIG_UNIXSTATICLIBS)
  240.  
  241. EXE_CL=$(EXE_WINCL)
  242. EXE_SV=$(EXE_WINSV)
  243. EXE_SDL=$(EXE_WINSDL)
  244. EXE_CLNEXUIZ=$(EXE_WINCLNEXUIZ)
  245. EXE_SVNEXUIZ=$(EXE_WINSVNEXUIZ)
  246. EXE_SDLNEXUIZ=$(EXE_WINSDLNEXUIZ)
  247.  
  248. # libjpeg dependency (set these to "" if you want to use dynamic loading instead)
  249. CFLAGS_LIBJPEG=-DLINK_TO_LIBJPEG
  250. LIB_JPEG=-ljpeg
  251. endif
  252.  
  253. ##### Sound configuration #####
  254.  
  255. ifndef DP_SOUND_API
  256. DP_SOUND_API=$(DEFAULT_SNDAPI)
  257. endif
  258.  
  259. # NULL: no sound
  260. ifeq ($(DP_SOUND_API), NULL)
  261. OBJ_SOUND=$(OBJ_SND_NULL)
  262. LIB_SOUND=$(LIB_SND_NULL)
  263. endif
  264.  
  265. # OSS: Open Sound System
  266. ifeq ($(DP_SOUND_API), OSS)
  267. OBJ_SOUND=$(OBJ_SND_OSS)
  268. LIB_SOUND=$(LIB_SND_OSS)
  269. endif
  270.  
  271. # ALSA: Advanced Linux Sound Architecture
  272. ifeq ($(DP_SOUND_API), ALSA)
  273. OBJ_SOUND=$(OBJ_SND_ALSA)
  274. LIB_SOUND=$(LIB_SND_ALSA)
  275. endif
  276.  
  277. # COREAUDIO: Core Audio
  278. ifeq ($(DP_SOUND_API), COREAUDIO)
  279. OBJ_SOUND=$(OBJ_SND_COREAUDIO)
  280. LIB_SOUND=$(LIB_SND_COREAUDIO)
  281. endif
  282.  
  283. # BSD: BSD / Sun audio API
  284. ifeq ($(DP_SOUND_API), BSD)
  285. OBJ_SOUND=$(OBJ_SND_BSD)
  286. LIB_SOUND=$(LIB_SND_BSD)
  287. endif
  288.  
  289. # WIN: DirectX and Win32 WAVE output
  290. ifeq ($(DP_SOUND_API), WIN)
  291. OBJ_SOUND=$(OBJ_SND_WIN)
  292. LIB_SOUND=$(LIB_SND_WIN)
  293. endif
  294.  
  295. ifeq ($(DP_SOUND_API),3DRAS)
  296. OBJ_SOUND=$(OBJ_SND_3DRAS)
  297. LIB_SOUND=$(LIB_SND_3DRAS)
  298. endif
  299.  
  300. ##### Extra CFLAGS #####
  301.  
  302. CFLAGS_MAKEDEP?=-MMD
  303. ifdef DP_FS_BASEDIR
  304. CFLAGS_FS=-DDP_FS_BASEDIR='\"$(DP_FS_BASEDIR)\"'
  305. else
  306. CFLAGS_FS=
  307. endif
  308.  
  309. CFLAGS_PRELOAD=
  310. ifneq ($(DP_MAKE_TARGET), mingw)
  311. ifdef DP_PRELOAD_DEPENDENCIES
  312. # DP_PRELOAD_DEPENDENCIES: when set, link against the libraries needed using -l
  313. # dynamically so they won't get loaded at runtime using dlopen
  314. LDFLAGS_CL+=$(LDFLAGS_UNIXCL_PRELOAD)
  315. LDFLAGS_SV+=$(LDFLAGS_UNIXSV_PRELOAD)
  316. LDFLAGS_SDL+=$(LDFLAGS_UNIXSDL_PRELOAD)
  317. CFLAGS_PRELOAD=$(CFLAGS_UNIX_PRELOAD)
  318. endif
  319. endif
  320.  
  321. ##### GNU Make specific definitions #####
  322.  
  323. DO_LD=$(CC) -o $@ $^ $(LDFLAGS)
  324.  
  325.  
  326. ##### Definitions shared by all makefiles #####
  327. include makefile.inc
  328.  
  329.  
  330. ##### Dependency files #####
  331.  
  332. -include *.d
  333.  
  334. # hack to deal with no-longer-needed .h files
  335. %.h:
  336. @echo
  337. @echo "NOTE: file $@ mentioned in dependencies missing, continuing..."
  338. @echo "HINT: consider 'make clean'"
  339. @echo
  340. apples-Mac-mini:buildforapple r00t$
  341.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement