Makefile 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. #
  2. # Makefile generated by fpcmake v0.99.13 [2000/02/09]
  3. #
  4. defaultrule: all
  5. #####################################################################
  6. # Autodetect OS (Linux or Dos or Windows NT)
  7. # define inlinux when running under linux
  8. # define inWinNT when running under WinNT
  9. #####################################################################
  10. # We need only / in the path
  11. override PATH:=$(subst \,/,$(PATH))
  12. # Search for PWD and determine also if we are under linux
  13. PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(subst ;, ,$(PATH)))))
  14. ifeq ($(PWD),)
  15. PWD:=$(strip $(wildcard $(addsuffix /pwd,$(subst :, ,$(PATH)))))
  16. ifeq ($(PWD),)
  17. nopwd:
  18. @echo You need the GNU utils package to use this Makefile!
  19. @echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
  20. @exit
  21. else
  22. inlinux=1
  23. endif
  24. else
  25. PWD:=$(firstword $(PWD))
  26. endif
  27. # Detect NT - NT sets OS to Windows_NT
  28. ifndef inlinux
  29. ifeq ($(OS),Windows_NT)
  30. inWinNT=1
  31. endif
  32. endif
  33. # Detect OS/2 - OS/2 has OS2_SHELL defined
  34. ifndef inlinux
  35. ifndef inWinNT
  36. ifdef OS2_SHELL
  37. inOS2=1
  38. endif
  39. endif
  40. endif
  41. # The extension of executables
  42. ifdef inlinux
  43. EXEEXT=
  44. else
  45. EXEEXT=.exe
  46. endif
  47. # The path which is searched separated by spaces
  48. ifdef inlinux
  49. SEARCHPATH=$(subst :, ,$(PATH))
  50. else
  51. SEARCHPATH=$(subst ;, ,$(PATH))
  52. endif
  53. # Base dir
  54. ifdef PWD
  55. BASEDIR:=$(shell $(PWD))
  56. else
  57. BASEDIR=.
  58. endif
  59. #####################################################################
  60. # FPC version/target Detection
  61. #####################################################################
  62. # What compiler to use ?
  63. ifndef FPC
  64. # Compatibility with old makefiles
  65. ifdef PP
  66. FPC=$(PP)
  67. else
  68. ifdef inOS2
  69. FPC=ppos2
  70. else
  71. FPC=ppc386
  72. endif
  73. endif
  74. endif
  75. override FPC:=$(subst $(EXEEXT),,$(FPC))
  76. override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
  77. # Target OS
  78. ifndef OS_TARGET
  79. OS_TARGET:=$(shell $(FPC) -iTO)
  80. endif
  81. # Source OS
  82. ifndef OS_SOURCE
  83. OS_SOURCE:=$(shell $(FPC) -iSO)
  84. endif
  85. # Target CPU
  86. ifndef CPU_TARGET
  87. CPU_TARGET:=$(shell $(FPC) -iTP)
  88. endif
  89. # Source CPU
  90. ifndef CPU_SOURCE
  91. CPU_SOURCE:=$(shell $(FPC) -iSP)
  92. endif
  93. # FPC version
  94. ifndef FPC_VERSION
  95. FPC_VERSION:=$(shell $(FPC) -iV)
  96. endif
  97. export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
  98. #####################################################################
  99. # FPCDIR Setting
  100. #####################################################################
  101. # Test FPCDIR to look if the RTL dir exists
  102. ifdef FPCDIR
  103. override FPCDIR:=$(subst \,/,$(FPCDIR))
  104. ifeq ($(wildcard $(FPCDIR)/rtl),)
  105. ifeq ($(wildcard $(FPCDIR)/units),)
  106. override FPCDIR=wrong
  107. endif
  108. endif
  109. else
  110. override FPCDIR=wrong
  111. endif
  112. # Detect FPCDIR
  113. ifeq ($(FPCDIR),wrong)
  114. ifdef inlinux
  115. override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
  116. ifeq ($(wildcard $(FPCDIR)/units),)
  117. override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
  118. endif
  119. else
  120. override FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))))
  121. override FPCDIR:=$(FPCDIR)/..
  122. ifeq ($(wildcard $(FPCDIR)/rtl),)
  123. ifeq ($(wildcard $(FPCDIR)/units),)
  124. override FPCDIR:=$(FPCDIR)/..
  125. ifeq ($(wildcard $(FPCDIR)/rtl),)
  126. ifeq ($(wildcard $(FPCDIR)/units),)
  127. override FPCDIR=c:/pp
  128. endif
  129. endif
  130. endif
  131. endif
  132. endif
  133. endif
  134. #####################################################################
  135. # User Settings
  136. #####################################################################
  137. # Targets
  138. # Clean
  139. # Install
  140. ZIPTARGET=install
  141. # Defaults
  142. # Directories
  143. # Packages
  144. # Libraries
  145. #####################################################################
  146. # Default Directories
  147. #####################################################################
  148. # set the prefix directory where to install everything
  149. ifndef PREFIXINSTALLDIR
  150. ifdef inlinux
  151. PREFIXINSTALLDIR=/usr
  152. else
  153. PREFIXINSTALLDIR=/pp
  154. endif
  155. endif
  156. export PREFIXINSTALLDIR
  157. # Where to place the resulting zip files
  158. ifndef DESTZIPDIR
  159. DESTZIPDIR:=$(BASEDIR)
  160. endif
  161. export DESTZIPDIR
  162. #####################################################################
  163. # Redirection
  164. #####################################################################
  165. ifndef REDIRFILE
  166. REDIRFILE=log
  167. endif
  168. ifdef REDIR
  169. ifndef inlinux
  170. override FPC=redir -eo $(FPC)
  171. endif
  172. # set the verbosity to max
  173. override FPCOPT+=-va
  174. override REDIR:= >> $(REDIRFILE)
  175. endif
  176. #####################################################################
  177. # Standard rules
  178. #####################################################################
  179. #####################################################################
  180. # Local Makefile
  181. #####################################################################
  182. ifneq ($(wildcard fpcmake.loc),)
  183. include fpcmake.loc
  184. endif
  185. #####################################################################
  186. # Users rules
  187. #####################################################################
  188. all:
  189. $(MAKE) -C $(OS_TARGET) all