Makefile 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500
  1. #
  2. # $Id$
  3. # Copyright (c) 1999 by the Free Pascal Development Team
  4. #
  5. # Makefile for Free Pascal Source Tree
  6. #
  7. # See the file COPYING.FPC, included in this distribution,
  8. # for details about the copyright.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. #
  14. #####################################################################
  15. # Config
  16. #####################################################################
  17. # Try to determine which modules are installed
  18. MODULES+=$(wildcard compiler)
  19. MODULES+=$(wildcard rtl)
  20. MODULES+=$(wildcard utils)
  21. MODULES+=$(wildcard fcl)
  22. MODULES+=$(wildcard gtk)
  23. MODULES+=$(wildcard api)
  24. MODULES+=$(wildcard fv)
  25. MODULES+=$(wildcard gdbint)
  26. MODULES+=$(wildcard ide)
  27. ###############################
  28. # Default paths
  29. ###############################
  30. ifndef RTLDIR
  31. RTLDIR=rtl
  32. endif
  33. ifndef COMPILERDIR
  34. COMPILERDIR=compiler
  35. endif
  36. ifndef UTILSDIR
  37. UTILSDIR=utils
  38. endif
  39. ifndef FCLDIR
  40. FCLDIR=fcl
  41. endif
  42. ifndef GTKDIR
  43. GTKDIR=gtk
  44. endif
  45. ifndef APIDIR
  46. APIDIR=api
  47. endif
  48. ifndef FVDIR
  49. FVDIR=fv
  50. endif
  51. ifndef GDBDIR
  52. GDBDIR=gdbint
  53. endif
  54. ifndef FPINSTDIR
  55. FPINSTDIR=fpinst
  56. endif
  57. ifndef IDEDIR
  58. IDEDIR=ide
  59. endif
  60. #####################################################################
  61. # Defaults
  62. #####################################################################
  63. RELEASE=1
  64. #####################################################################
  65. # Main targets
  66. #####################################################################
  67. .PHONY: all clean install staticinstall sharedinstall \
  68. $(addsuffix _all,$(MODULES)) \
  69. $(addsuffix _clean,$(MODULES)) \
  70. $(addsuffix _install,$(MODULES)) \
  71. $(addsuffix _staticinstall,$(MODULES)) \
  72. $(addsuffix _sharedinstall,$(MODULES))\
  73. compiler_cycle \
  74. idezips ide_allzip ide_gdbzip ide_fullzip ide_fullgdbzip \
  75. fclzip gtkzip fvzip compilerzip utilszip
  76. info:
  77. @echo
  78. @echo Please use one of the following targets:
  79. @echo
  80. @echo $(MODULES)
  81. @echo
  82. @echo All targets can follow after a _ with:
  83. @echo all,clean,install,staticinstall,sharedinstall
  84. @echo
  85. @echo example: make api_staticinstall
  86. @exit
  87. all: $(addsuffix _all,$(MODULES))
  88. clean: $(addsuffix _clean,$(MODULES))
  89. install: $(addsuffix _install,$(MODULES))
  90. staticinstall: $(addsuffix _staticinstall,$(MODULES))
  91. sharedinstall: $(addsuffix _sharedinstall,$(MODULES))
  92. #####################################################################
  93. # Include default makefile
  94. #####################################################################
  95. # test if FPCMAKE is still valid
  96. ifndef FPCMAKE
  97. ifdef FPCDIR
  98. FPCMAKE=$(FPCDIR)/makefile.fpc
  99. endif
  100. endif
  101. ifdef FPCMAKE
  102. ifeq ($(strip $(wildcard $(FPCMAKE))),)
  103. FPCDIR=
  104. FPCMAKE=
  105. endif
  106. endif
  107. ifndef FPCDIR
  108. ifdef DEFAULTFPCDIR
  109. FPCDIR=$(DEFAULTFPCDIR)
  110. endif
  111. endif
  112. ifndef FPCMAKE
  113. ifdef FPCDIR
  114. FPCMAKE=$(FPCDIR)/makefile.fpc
  115. else
  116. FPCMAKE=makefile.fpc
  117. endif
  118. endif
  119. override FPCMAKE:=$(strip $(wildcard $(FPCMAKE)))
  120. ifndef FPCMAKE
  121. testfpcmake:
  122. @echo makefile.fpc not found!
  123. @echo Check the FPCMAKE and FPCDIR environment variables.
  124. @stopnow
  125. ifndef NODEFAULTALL
  126. all: testfpcmake
  127. endif
  128. install: testfpcmake
  129. clean: testfpcmake
  130. else
  131. include $(FPCMAKE)
  132. testfpcmake:
  133. endif
  134. #####################################################################
  135. # Dependencies
  136. #####################################################################
  137. #######################################
  138. # RTL
  139. #######################################
  140. override RTLDIR:=$(RTLDIR)/$(OS_TARGET)
  141. rtl_all:
  142. $(MAKE) -C $(RTLDIR) all
  143. rtl_clean:
  144. $(MAKE) -C $(RTLDIR) clean
  145. rtl_install:
  146. $(MAKE) -C $(RTLDIR) install
  147. rtl_staticinstall:
  148. $(MAKE) -C $(RTLDIR) staticlibinstall
  149. rtl_sharedinstall:
  150. $(MAKE) -C $(RTLDIR) sharedlibinstall
  151. #######################################
  152. # Compiler
  153. #######################################
  154. compiler_cycle:
  155. $(MAKE) -C $(COMPILERDIR) cycle
  156. compiler_all: rtl_all
  157. $(MAKE) -C $(COMPILERDIR) all
  158. compiler_clean:
  159. $(MAKE) -C $(COMPILERDIR) distclean
  160. compiler_install:
  161. $(MAKE) -C $(COMPILERDIR) install
  162. compiler_installlib:
  163. $(MAKE) -C $(COMPILERDIR) installlib
  164. compiler_staticinstall:
  165. compiler_sharedinstall:
  166. #######################################
  167. # Utils
  168. #######################################
  169. utils_all: rtl_all
  170. $(MAKE) -C $(UTILSDIR) all
  171. utils_clean:
  172. $(MAKE) -C $(UTILSDIR) clean
  173. utils_install:
  174. $(MAKE) -C $(UTILSDIR) install
  175. utils_installlib:
  176. $(MAKE) -C $(UTILSDIR) installlib
  177. utils_staticinstall:
  178. utils_sharedinstall:
  179. #######################################
  180. # FCL
  181. #######################################
  182. override FCLDIR:=$(FCLDIR)/$(OS_TARGET)
  183. fcl_all: rtl_all
  184. $(MAKE) -C $(FCLDIR) all
  185. fcl_clean:
  186. $(MAKE) -C $(FCLDIR) clean
  187. fcl_install:
  188. $(MAKE) -C $(FCLDIR) install
  189. fcl_staticinstall:
  190. $(MAKE) -C $(FCLDIR) staticlibinstall
  191. fcl_sharedinstall:
  192. $(MAKE) -C $(FCLDIR) sharedlibinstall
  193. #######################################
  194. # GTK
  195. #######################################
  196. gtk_all: rtl_all
  197. $(MAKE) -C $(GTKDIR) all
  198. gtk_clean:
  199. $(MAKE) -C $(GTKDIR) clean
  200. gtk_install:
  201. $(MAKE) -C $(GTKDIR) install
  202. gtk_staticinstall:
  203. $(MAKE) -C $(GTKDIR) staticlibinstall
  204. gtk_sharedinstall:
  205. $(MAKE) -C $(GTKDIR) sharedlibinstall
  206. #######################################
  207. # API
  208. #######################################
  209. api_all: rtl_all
  210. $(MAKE) -C $(APIDIR) all
  211. api_clean:
  212. $(MAKE) -C $(APIDIR) clean
  213. api_install:
  214. $(MAKE) -C $(APIDIR) install
  215. api_staticinstall:
  216. $(MAKE) -C $(APIDIR) staticlibinstall
  217. api_sharedinstall:
  218. $(MAKE) -C $(APIDIR) sharedlibinstall
  219. #######################################
  220. # FV
  221. #######################################
  222. fv_all: rtl_all api_all
  223. $(MAKE) -C $(FVDIR) all
  224. fv_clean:
  225. $(MAKE) -C $(FVDIR) clean
  226. fv_install:
  227. $(MAKE) -C $(FVDIR) install
  228. fv_staticinstall:
  229. $(MAKE) -C $(FVDIR) staticlibinstall
  230. fv_sharedinstall:
  231. $(MAKE) -C $(FVDIR) sharedlibinstall
  232. #######################################
  233. # GDB
  234. #######################################
  235. gdb_all: rtl_all
  236. $(MAKE) -C $(GDBDIR) all
  237. gdb_clean:
  238. $(MAKE) -C $(GDBDIR) clean
  239. gdb_install:
  240. $(MAKE) -C $(GDBDIR) install
  241. gdb_staticinstall:
  242. $(MAKE) -C $(GDBDIR) staticlibinstall
  243. gdb_sharedinstall:
  244. $(MAKE) -C $(GDBDIR) sharedlibinstall
  245. #######################################
  246. # FPC fpinst
  247. #######################################
  248. fpinst_all: rtl_all api_all fv_all
  249. $(MAKE) -C $(FPINSTDIR) all
  250. fpinst_clean:
  251. $(MAKE) -C $(FPINSTDIR) clean
  252. fpinst_install:
  253. $(MAKE) -C $(FPINSTDIR) install
  254. fpinst_staticinstall:
  255. $(MAKE) -C $(FPINSTDIR) staticlibinstall
  256. fpinst_sharedinstall:
  257. $(MAKE) -C $(FPINSTDIR) sharedlibinstall
  258. #######################################
  259. # IDE
  260. #######################################
  261. ide_all: rtl_all api_all fv_all
  262. $(MAKE) -C $(IDEDIR) all
  263. ide_gdb: rtl_all api_all fv_all gdb_all
  264. $(MAKE) -C $(IDEDIR) gdb
  265. ide_full: rtl_all api_all fv_all
  266. $(MAKE) -C $(IDEDIR) full
  267. ide_fullgdb: rtl_all api_all fv_all gdb_all
  268. $(MAKE) -C $(IDEDIR) fullgdb
  269. ide_clean:
  270. $(MAKE) -C $(IDEDIR) clean
  271. ide_install:
  272. $(MAKE) -C $(IDEDIR) install
  273. ide_staticinstall:
  274. $(MAKE) -C $(IDEDIR) staticlibinstall
  275. ide_sharedinstall:
  276. $(MAKE) -C $(IDEDIR) sharedlibinstall
  277. #######################################
  278. # Install targets
  279. #######################################
  280. base_install:
  281. $(INSTALL) base/Makefile $(LIBINSTALLDIR)
  282. $(INSTALL) base/makefile.fpc $(LIBINSTALLDIR)
  283. demo_install:
  284. $(MAKE) -C demo installdemo
  285. man_install:
  286. $(MAKE) -C man installman
  287. #######################################
  288. # Packaging targets
  289. #######################################
  290. ifndef ZIPTARGET
  291. ZIPTARGET=install
  292. endif
  293. export ZIPTARGET
  294. export PACKAGEDIR=$(BASEDIR)
  295. idezips: clean ide_allzip ide_gdbzip ide_fullzip ide_fullgdbzip
  296. ide_allzip:
  297. $(MAKE) ide_clean
  298. $(MAKE) ide_all
  299. $(MAKE) -C $(IDEDIR)/text fpc_zipinstall ZIPNAME=ide-fake-$(PACKAGESUFFIX)
  300. ide_gdbzip:
  301. $(MAKE) ide_clean
  302. $(MAKE) ide_gdb
  303. $(MAKE) -C $(IDEDIR)/text fpc_zipinstall ZIPNAME=ide-gdb-$(PACKAGESUFFIX)
  304. ide_fullzip:
  305. $(MAKE) ide_clean
  306. $(MAKE) ide_full
  307. $(MAKE) -C $(IDEDIR)/text fpc_zipinstall ZIPNAME=ide-comp-$(PACKAGESUFFIX)
  308. ide_fullgdbzip:
  309. $(MAKE) ide_clean
  310. $(MAKE) ide_fullgdb
  311. $(MAKE) -C $(IDEDIR)/text fpc_zipinstall ZIPNAME=ide-full-$(PACKAGESUFFIX)
  312. fvzip: rtl_clean api_clean fv_clean
  313. $(MAKE) api_all
  314. $(MAKE) -C $(APIDIR) fpc_zipinstall ZIPNAME=fv-$(PACKAGESUFFIX)
  315. $(MAKE) fv_all
  316. $(MAKE) -C $(FVDIR) fpc_zipinstalladd ZIPNAME=fv-$(PACKAGESUFFIX)
  317. fclzip: rtl_clean fcl_clean
  318. $(MAKE) fcl_all
  319. $(MAKE) -C $(FCLDIR) fpc_zipinstall ZIPNAME=fcl-$(PACKAGESUFFIX)
  320. gtkzip: rtl_clean gtk_clean
  321. $(MAKE) gtk_all
  322. $(MAKE) -C $(GTKDIR) fpc_zipinstall ZIPNAME=gtk-$(PACKAGESUFFIX)
  323. compilerzip: compiler_clean rtl_clean
  324. $(MAKE) compiler_all
  325. $(MAKE) -C $(COMPILERDIR) fpc_zipinstall ZIPTARGET=quickinstall ZIPNAME=compiler-$(PACKAGESUFFIX)
  326. $(MAKE) -C $(RTLDIR) fpc_zipinstalladd ZIPNAME=compiler-$(PACKAGESUFFIX)
  327. utilszip: utils_clean rtl_clean
  328. $(MAKE) utils_all
  329. $(MAKE) -C $(UTILSDIR) fpc_zipinstall ZIPNAME=utils-$(PACKAGESUFFIX)
  330. #
  331. # $Log$
  332. # Revision 1.18.2.1 1999-07-05 17:03:20 peter
  333. # * modules are checked if they exists
  334. #
  335. # Revision 1.18 1999/06/08 22:11:26 peter
  336. # * debian updates
  337. #
  338. # Revision 1.17 1999/06/08 18:28:11 peter
  339. # * fixes for 0.99.12 release
  340. #
  341. # Revision 1.16 1999/05/16 02:37:29 peter
  342. # + fpc_showinstallfiles to show which files will be added to the system
  343. #
  344. # Revision 1.15 1999/05/12 16:17:06 peter
  345. # + utils_X targets
  346. # * missing export of prefixinstalldir
  347. #
  348. # Revision 1.14 1999/04/21 10:25:39 michael
  349. # + Split idezips target
  350. #
  351. # Revision 1.13 1999/04/19 12:53:02 peter
  352. # * fixed idezips target
  353. #
  354. # Revision 1.12 1999/04/16 20:15:41 michael
  355. # + Adapted ide Makefiles
  356. #
  357. # Revision 1.11 1999/04/08 10:16:16 peter
  358. # * zipinstall for linux with .tar.gz
  359. #
  360. # Revision 1.10 1999/04/01 22:16:02 peter
  361. # * renamed ide zips
  362. #
  363. # Revision 1.9 1999/03/18 11:19:31 peter
  364. # * fixed zipinstall
  365. #
  366. # Revision 1.8 1999/03/16 00:46:54 peter
  367. # * makefile.fpc targets start with fpc_
  368. # * small updates for install scripts
  369. #
  370. # Revision 1.7 1999/03/09 01:35:46 peter
  371. # * makefile.fpc updates and defaultfpcdir var
  372. #
  373. #