Advertisement
Guest User

Untitled

a guest
Feb 15th, 2013
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.19 KB | None | 0 0
  1. #makefile for Uplink
  2.  
  3. # Uncomment below for release builds
  4. RELEASE=release
  5. VERSION=1.31
  6.  
  7. # -include ../stlport.mk
  8.  
  9. GL_LIBDIR = /usr/X11R6/lib
  10. #GL_LIBDIR = /usr/lib
  11. CONTRIB_DIR:= $(shell pwd)/../contrib
  12. #/home/jak/devel/contrib
  13. TCP4U_DIR = $(CONTRIB_DIR)/tcp4u.330
  14. GLTT_DIR = $(CONTRIB_DIR)/install
  15.  
  16. FTGL_DIR_INC = $(CONTRIB_DIR)/ftgl_dist/src
  17. FTGL_DIR_LIB = $(CONTRIB_DIR)/ftgl_dist/linux
  18. FT2_DIR1 = $(CONTRIB_DIR)/install/include/freetype2
  19. FT2_DIR2 = $(CONTRIB_DIR)/install/include/freetype2/freetype
  20.  
  21. # for GLTT
  22. FONTINCS = -I$(CONTRIB_DIR)/install
  23. STATIC_FONTLIBS = $(GLTT_DIR)/lib/libgltt.a /usr/lib/libttf.a
  24. #DYNAMIC_FONTLIBS = -lttf
  25.  
  26. # for FTGL
  27. #FONTINCS = -I$(FTGL_DIR_INC) -I$(FT2_DIR1) -I$(FT2_DIR2)
  28. #STATIC_FONTLIBS = -L$(FTGL_DIR_LIB) -lftgl -lfreetype
  29. ##$(CONTRIB_DIR)/install/lib/libfreetype.a
  30. #DYNAMIC_FONTLIBS =
  31.  
  32. #MikMod:
  33. #MIKMOD_DIR = $(CONTRIB_DIR)/install
  34. #STATIC_SOUNDLIBS = $(MIKMOD_DIR)/lib/libmikmod.a
  35. #DYNAMIC_SOUNDLIBS =
  36.  
  37. #SDL_Mixer:
  38.  
  39. STATIC_SDLLIBS = $(CONTRIB_DIR)/install/lib/libSDL_mixer.a \
  40. $(CONTRIB_DIR)/install/lib/libSDL.a \
  41. /usr/lib/libasound.a \
  42. /usr/lib/libesd.a
  43.  
  44. DYNAMIC_SDLLIBS = $(CONTRIB_DIR)/install/lib/libSDL.la \
  45. $(CONTRIB_DIR)/install/lib/libSDL_mixer.la
  46.  
  47. #DYNAMIC_SDLLIBS = $(CONTRIB_DIR)/install/lib/libSDL-1.2.so.0 \
  48. # $(CONTRIB_DIR)/install/lib/libSDL_mixer-1.2.so.0
  49.  
  50. #GLUT_LIB = -lglut
  51. #GL_LIB = -L$(GL_LIBDIR) -lGL -lGLU
  52. GL_LIB = $(GL_LIBDIR)/libGL.so.1 $(GL_LIBDIR)/libGLU.so.1
  53. #-lXmu
  54. #-lXxf86vm
  55.  
  56. IRCLIB_DIR = $(CONTRIB_DIR)/irclib.linux
  57.  
  58. LIBTOOL=libtool
  59.  
  60. INCLUDES = -I. \
  61. -I/usr/X11R6/include/ \
  62. -I../lib/eclipse/ \
  63. -I../lib/tosser/ \
  64. -I../lib/soundgarden/ \
  65. -I../lib/vanbakel/ \
  66. -I../lib/gucci/ \
  67. -I../lib/bungle \
  68. -I../lib/redshirt/ \
  69. -I../lib/slasher \
  70. -I$(TCP4U_DIR)/Include \
  71. $(FONTINCS) \
  72. -I$(IRCLIB_DIR) \
  73. -I$(IRCLIB_DIR)/linux
  74.  
  75. INTERNALLIBS = ../lib/gucci/libgucci.a \
  76. ../lib/eclipse/libeclipse.a \
  77. ../lib/vanbakel/libvanbakel.a \
  78. ../lib/soundgarden/libsoundgarden.a \
  79. ../lib/redshirt/libredshirt.a \
  80. ../lib/bungle/libbungle.a
  81. # ../lib/slasher/libslasher.a
  82.  
  83. STATICLIBS = -Wl,-Bstatic \
  84. $(INTERNALLIBS) \
  85. -L$(TCP4U_DIR)/src \
  86. -L$(IRCLIB_DIR) \
  87. /usr/lib/libtiff.a \
  88. /usr/lib/libjpeg.a -lz \
  89. $(STATIC_FONTLIBS) \
  90. -ltcp4ux \
  91. -lirclib
  92.  
  93. # $(-lXxf86vm
  94.  
  95.  
  96. DYNAMICLIBS = -Wl,-Bdynamic \
  97. $(GLUT_LIB) $(GL_LIB) \
  98. $(DYNAMIC_FONTLIBS) \
  99. -ldl
  100.  
  101. #-lpthread
  102.  
  103. CXXLIB = -Wl,-Bstatic $(STLPORTLIB) -lstdc++
  104.  
  105. MATHLIB = -Wl,-Bdynamic -lm
  106.  
  107. ifndef RELEASE
  108. #MALLOCLIB = -Wl,-Bstatic -L$(CONTRIB_DIR)/install/lib -ldmallocthcxx
  109. endif
  110.  
  111. UPLINKSTATICLIBS = $(STATICLIBS) $(STATIC_SDLLIBS) $(DYNAMICLIBS) $(CXXLIB) $(MALLOCLIB) $(MATHLIB)
  112. UPLINKDYNAMICLIBS = $(STATICLIBS) $(DYNAMIC_SDLLIBS) $(DYNAMICLIBS) $(CXXLIB) $(MALLOCLIB) $(MATHLIB)
  113.  
  114. CXX = g++
  115. LINK = $(CC)
  116.  
  117. ifdef RELEASE
  118. CXXFLAGS += -O2
  119. STRIP = strip
  120. UPX := upx
  121. else
  122. CXXFLAGS += -g -D_DEBUG
  123. #CXXFLAGS += -DSLASHER
  124. STRIP = :
  125. UPX = :
  126. endif
  127.  
  128. NM = nm
  129.  
  130. CXXFLAGS += $(INCLUDES) -w -D_REENTRANT
  131. OBJDIR = obj/linux
  132.  
  133. # To produce the source list, use:
  134. # find . -name '*.cpp' | sed 's%^\./\(.*\)%\1 \\%'
  135. # and remove the last backslash (\) by hand
  136.  
  137. SOURCES1= \
  138. app/app.cpp \
  139. app/dos2unix.cpp \
  140. app/miscutils.cpp \
  141. app/opengl.cpp \
  142. app/opengl_interface.cpp \
  143. app/probability.cpp \
  144. app/serialise.cpp \
  145. app/uplinkobject.cpp \
  146. game/data/data.cpp \
  147. game/game.cpp \
  148. game/gameobituary.cpp \
  149. game/scriptlibrary.cpp \
  150. interface/interface.cpp \
  151. interface/interfacescreen.cpp \
  152. interface/localinterface/analyser_interface.cpp \
  153. interface/localinterface/cheat_interface.cpp \
  154. interface/localinterface/email_interface.cpp \
  155. interface/localinterface/evtqueue_interface.cpp \
  156. interface/localinterface/finance_interface.cpp \
  157. interface/localinterface/gateway_interface.cpp \
  158. interface/localinterface/hud_interface.cpp \
  159. interface/localinterface/hw_interface.cpp \
  160. interface/localinterface/irc_interface.cpp \
  161. interface/localinterface/keyboardinterface.cpp \
  162. interface/localinterface/lan_interface.cpp \
  163. interface/localinterface/localinterface.cpp \
  164. interface/localinterface/localinterfacescreen.cpp \
  165. interface/localinterface/memory_interface.cpp \
  166. interface/localinterface/mission_interface.cpp \
  167. interface/localinterface/phonedialler.cpp \
  168. interface/localinterface/sendmail_interface.cpp \
  169. interface/localinterface/status_interface.cpp \
  170. interface/localinterface/sw_interface.cpp \
  171. interface/localinterface/worldmap/worldmap_interface.cpp \
  172. interface/localinterface/worldmap/worldmap_layout.cpp \
  173. interface/remoteinterface/academicscreen_interface.cpp \
  174. interface/remoteinterface/accountscreen_interface.cpp \
  175. interface/remoteinterface/bbsscreen_interface.cpp \
  176. interface/remoteinterface/changegatewayscreen_interface.cpp \
  177. interface/remoteinterface/codecardscreen_interface.cpp \
  178. interface/remoteinterface/companyinfoscreen_interface.cpp \
  179. interface/remoteinterface/consolescreen_interface.cpp \
  180. interface/remoteinterface/contactscreen_interface.cpp \
  181. interface/remoteinterface/criminalscreen_interface.cpp \
  182. interface/remoteinterface/cypherscreen_interface.cpp \
  183. interface/remoteinterface/dialogscreen_interface.cpp \
  184. interface/remoteinterface/disconnectedscreen_interface.cpp \
  185. interface/remoteinterface/faithscreen_interface.cpp \
  186. interface/remoteinterface/fileserverscreen_interface.cpp \
  187. interface/remoteinterface/highsecurityscreen_interface.cpp \
  188. interface/remoteinterface/hwsalesscreen_interface.cpp \
  189. interface/remoteinterface/linksscreen_interface.cpp \
  190. interface/remoteinterface/loansscreen_interface.cpp \
  191. interface/remoteinterface/logscreen_interface.cpp \
  192. interface/remoteinterface/menuscreen_interface.cpp \
  193. interface/remoteinterface/messagescreen_interface.cpp \
  194. interface/remoteinterface/nearestgatewayscreen_interface.cpp \
  195. interface/remoteinterface/newsscreen_interface.cpp \
  196. interface/remoteinterface/nuclearwarscreen_interface.cpp \
  197. interface/remoteinterface/passwordscreen_interface.cpp \
  198. interface/remoteinterface/protovisionscreen_interface.cpp \
  199. interface/remoteinterface/radiotransmitterscreen_interface.cpp \
  200. interface/remoteinterface/rankingscreen_interface.cpp \
  201. interface/remoteinterface/recordscreen_interface.cpp \
  202. interface/remoteinterface/remoteinterface.cpp \
  203. interface/remoteinterface/remoteinterfacescreen.cpp \
  204. interface/remoteinterface/securityscreen_interface.cpp \
  205. interface/remoteinterface/shareslistscreen_interface.cpp \
  206. interface/remoteinterface/sharesviewscreen_interface.cpp \
  207. interface/remoteinterface/socialsecurityscreen_interface.cpp \
  208. interface/remoteinterface/swsalesscreen_interface.cpp \
  209. interface/remoteinterface/useridscreen_interface.cpp \
  210. interface/remoteinterface/voiceanalysisscreen_interface.cpp \
  211. interface/remoteinterface/voicephonescreen_interface.cpp \
  212. interface/scrollbox.cpp \
  213. interface/taskmanager/decrypter.cpp \
  214. interface/taskmanager/decypher.cpp \
  215. interface/taskmanager/defrag.cpp \
  216. interface/taskmanager/dictionaryhacker.cpp \
  217. interface/taskmanager/faith.cpp \
  218. interface/taskmanager/filecopier.cpp \
  219. interface/taskmanager/filedeleter.cpp \
  220. interface/taskmanager/firewalldisable.cpp \
  221. interface/taskmanager/gatewaynuke.cpp \
  222. interface/taskmanager/iplookup.cpp \
  223. interface/taskmanager/ipprobe.cpp \
  224. interface/taskmanager/lanforce.cpp \
  225. interface/taskmanager/lanprobe.cpp \
  226. interface/taskmanager/lanscan.cpp \
  227. interface/taskmanager/lanspoof.cpp \
  228. interface/taskmanager/logdeleter.cpp \
  229. interface/taskmanager/logmodifier.cpp \
  230. interface/taskmanager/logundeleter.cpp \
  231. interface/taskmanager/motionsensor.cpp \
  232. interface/taskmanager/passwordbreaker.cpp \
  233. interface/taskmanager/proxydisable.cpp \
  234. interface/taskmanager/revelation.cpp \
  235. interface/taskmanager/revelationtracker.cpp \
  236. interface/taskmanager/securitybypass.cpp \
  237. interface/taskmanager/taskmanager.cpp \
  238. interface/taskmanager/tracetracker.cpp \
  239. interface/taskmanager/tutorial.cpp \
  240. interface/taskmanager/uplinkagentlist.cpp \
  241. interface/taskmanager/uplinktask.cpp \
  242. interface/taskmanager/voiceanalyser.cpp \
  243. mainmenu/closing_interface.cpp \
  244. mainmenu/connectionlost_interface.cpp \
  245. mainmenu/demogameover_interface.cpp \
  246. mainmenu/disavowed_interface.cpp \
  247. mainmenu/firsttimeloading_interface.cpp \
  248. mainmenu/genericoptions_interface.cpp \
  249. mainmenu/loading_interface.cpp \
  250. mainmenu/login_interface.cpp \
  251. mainmenu/mainmenu.cpp \
  252. mainmenu/mainmenuscreen.cpp \
  253. mainmenu/graphicoptions_interface.cpp \
  254. mainmenu/networkoptions_interface.cpp \
  255. mainmenu/obituary_interface.cpp \
  256. mainmenu/options_interface.cpp \
  257. mainmenu/revelationlost_interface.cpp \
  258. mainmenu/revelationwon_interface.cpp \
  259. mainmenu/theme_interface.cpp \
  260. mainmenu/theteam_interface.cpp \
  261. mainmenu/warezgameover_interface.cpp \
  262. network/clientconnection.cpp \
  263. network/interfaces/clientcommsinterface.cpp \
  264. network/interfaces/clientstatusinterface.cpp \
  265. network/interfaces/networkscreen.cpp \
  266. network/network.cpp \
  267. network/networkclient.cpp \
  268. network/networkserver.cpp \
  269. options/options.cpp \
  270. uplink.cpp \
  271. view/fps.cpp \
  272. view/view.cpp \
  273. world/agent.cpp \
  274. world/company/company.cpp \
  275. world/company/companyuplink.cpp \
  276. world/company/mission.cpp \
  277. world/company/news.cpp \
  278. world/company/sale.cpp \
  279. world/computer/bankaccount.cpp \
  280. world/computer/bankcomputer.cpp \
  281. world/computer/computer.cpp \
  282. world/computer/computerscreen/bbsscreen.cpp \
  283. world/computer/computerscreen/computerscreen.cpp \
  284. world/computer/computerscreen/cypherscreen.cpp \
  285. world/computer/computerscreen/dialogscreen.cpp \
  286. world/computer/computerscreen/disconnectedscreen.cpp \
  287. world/computer/computerscreen/genericscreen.cpp \
  288. world/computer/computerscreen/highsecurityscreen.cpp \
  289. world/computer/computerscreen/linksscreen.cpp \
  290. world/computer/computerscreen/logscreen.cpp \
  291. world/computer/computerscreen/menuscreen.cpp \
  292. world/computer/computerscreen/messagescreen.cpp \
  293. world/computer/computerscreen/passwordscreen.cpp \
  294. world/computer/computerscreen/shareslistscreen.cpp \
  295. world/computer/computerscreen/useridscreen.cpp \
  296. world/computer/databank.cpp \
  297. world/computer/gateway.cpp \
  298. world/computer/gatewaydef.cpp \
  299. world/computer/lancomputer.cpp \
  300. world/computer/lanmonitor.cpp \
  301. world/computer/logbank.cpp \
  302. world/computer/recordbank.cpp \
  303. world/computer/security.cpp \
  304. world/computer/securitymonitor.cpp \
  305. world/computer/securitysystem.cpp \
  306. world/connection.cpp \
  307. world/date.cpp \
  308. world/generator/consequencegenerator.cpp \
  309. world/generator/demoplotgenerator.cpp \
  310. world/generator/langenerator.cpp \
  311. world/generator/missiongenerator.cpp \
  312. world/generator/namegenerator.cpp \
  313. world/generator/newsgenerator.cpp \
  314. world/generator/numbergenerator.cpp \
  315. world/generator/plotgenerator.cpp \
  316. world/generator/recordgenerator.cpp \
  317. world/generator/worldgenerator.cpp \
  318. world/message.cpp \
  319. world/person.cpp \
  320. world/player.cpp \
  321. world/rating.cpp \
  322. world/scheduler/arrestevent.cpp \
  323. world/scheduler/attemptmissionevent.cpp \
  324. world/scheduler/bankrobberyevent.cpp \
  325. world/scheduler/changegatewayevent.cpp \
  326. world/scheduler/eventscheduler.cpp \
  327. world/scheduler/installhardwareevent.cpp \
  328. world/scheduler/notificationevent.cpp \
  329. world/scheduler/runplotsceneevent.cpp \
  330. world/scheduler/seizegatewayevent.cpp \
  331. world/scheduler/shotbyfedsevent.cpp \
  332. world/scheduler/uplinkevent.cpp \
  333. world/scheduler/warningevent.cpp \
  334. world/vlocation.cpp \
  335. world/world.cpp
  336.  
  337. SOURCES2 = app/decode.c
  338.  
  339. SOURCES = $(SOURCES1) $(SOURCES2)
  340.  
  341. ENCSRC = $(filter %.cpp, $(SOURCES))
  342.  
  343. OBJECTS = $(SOURCES1:%.cpp=$(OBJDIR)/%.o) $(SOURCES2:%.c=$(OBJDIR)/%.o)
  344.  
  345. all: uplink.dynamic
  346.  
  347. uplink.static: $(OBJECTS) $(INTERNALLIBS)
  348. @echo -n "Linking... "
  349. @$(LIBTOOL) --quiet $(LINK) $+ $(UPLINKSTATICLIBS) -o uplink.static
  350. @$(NM) uplink.static > uplink.static-linux.map
  351. @$(STRIP) uplink.static
  352. @echo done.
  353.  
  354. uplink.dynamic: $(OBJECTS) $(INTERNALLIBS)
  355. @echo -n "Linking... "
  356. @$(LIBTOOL) --quiet $(LINK) $+ $(UPLINKDYNAMICLIBS) -o uplink.dynamic
  357. @$(NM) uplink.dynamic > uplink.dynamic-linux.map
  358. @$(STRIP) uplink.dynamic
  359. @echo done.
  360.  
  361. dist: uplink.static uplink.dynamic
  362. @echo -n "Compressing..."
  363. @-$(UPX) uplink.dynamic 2> /dev/null > /dev/null
  364. @-$(UPX) uplink.static 2> /dev/null > /dev/null
  365. @echo "done"
  366. cp uplink.static ../dist/static/uplink
  367. cp ../changes.txt ../dist/static
  368. cp ../readme.txt ../dist/static
  369. cp ../testenv/patch.dat ../dist/static
  370. cp uplink.dynamic ../dist/dynamic/uplink-bin
  371. cp ../changes.txt ../dist/dynamic
  372. cp ../readme.txt ../dist/dynamic
  373. cp ../testenv/patch.dat ../dist/dynamic
  374. tar -C ../dist/static -c -z -f ../linuxpatch-static-$(VERSION).tar.gz .
  375. tar -C ../dist/dynamic -c -z -f ../linuxpatch-dynamic-$(VERSION).tar.gz .
  376.  
  377. FIXSAVEGAME_OBJECTS = fixsavegame.o $(filter-out obj/linux/uplink.o, $(OBJECTS))
  378.  
  379. fixsavegame: $(FIXSAVEGAME_OBJECTS)
  380. $(CXX) -o $@ $+ $(UPLINKSTATICLIBS)
  381.  
  382. encsrc: $(ENCSRC)
  383. ls -l $(ENCSRC)
  384.  
  385. objs: $(OBJECTS)
  386.  
  387. clean:
  388. rm -rf $(OBJDIR)/*
  389.  
  390. $(OBJDIR)/%.o: %.cpp
  391. @test -d $(dir $(OBJDIR)/$<) || mkdir -p $(dir $(OBJDIR)/$<)
  392. @echo Compiling $<
  393. @$(CXX) $(CXXFLAGS) -c $< -o $@
  394.  
  395. $(OBJDIR)/%.o: %.c
  396. @test -d $(dir $(OBJDIR)/$<) || mkdir -p $(dir $(OBJDIR)/$<)
  397. @echo Compiling $<
  398. @$(CC) $(CXXFLAGS) -c $< -o $@
  399.  
  400. include auto-depend.mk
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement