Makefile 9.5 KB

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