Makefile 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. #
  2. # $Id$
  3. # This file is part of the Free Pascal run time library.
  4. # Copyright (c) 1998 by the Free Pascal Development Team
  5. #
  6. # Makefile for the Free Pascal Objpas RTL
  7. #
  8. # See the file COPYING.FPC, included in this distribution,
  9. # for details about the copyright.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. #
  15. #####################################################################
  16. # Defaults
  17. #####################################################################
  18. # Where are the include files
  19. RTL=..
  20. CFG=$(RTL)/cfg
  21. INC=$(RTL)/inc
  22. PROCINC=$(RTL)/$(CPU)
  23. OBJPASDIR=.
  24. # Libname is always objpas
  25. override LIBNAME=objpas
  26. # Don't forget the -S2 switch
  27. override OPT+=-S2
  28. #####################################################################
  29. # Include configuration makefile
  30. #####################################################################
  31. # Get some defaults for Programs and OSes.
  32. # This will set the following variables :
  33. # inlinux COPY REPLACE DEL INSTALL INSTALLEXE MKDIR
  34. # It will also set OPT for cross-compilation, and add required options.
  35. # also checks for config file.
  36. # it expects CFG INC PROCINC to be set !!
  37. include $(CFG)/makefile.cfg
  38. #####################################################################
  39. # Objects
  40. #####################################################################
  41. EXEOBJECTS=
  42. UNITOBJECTS=objpas sysutils math
  43. #####################################################################
  44. # Main targets
  45. #####################################################################
  46. # Create Filenames
  47. EXEFILES=$(addsuffix $(EXEEXT),$(EXEOBJECTS))
  48. UNITFILES=$(addsuffix $(PPUEXT),$(UNITOBJECTS))
  49. UNITOFILES=$(addsuffix $(OEXT),$(UNITOBJECTS))
  50. .PHONY : all clean diffs install diffclean
  51. all : $(EXEFILES) $(UNITFILES) targetdir
  52. $(EXEFILES): %$(EXEEXT): %$(PASEXT)
  53. $(COMPILER) $*
  54. $(UNITFILES): %$(PPUEXT): %$(PASEXT)
  55. $(COMPILER) $*
  56. objpas$(PPUEXT): objpas$(PASEXT) $(INC)/except.inc
  57. # Need to change language file !!
  58. sysutils$(PPUEXT): objpas$(PPUEXT) sysutils$(PASEXT) sysstr.inc sysstrh.inc\
  59. stre.inc syspch.inc syspchh.inc dati.inc datih.inc \
  60. finah.inc fina.inc filutilh.inc
  61. targetdir:
  62. ifdef UNITTARGETDIR
  63. ifdef EXEOBJECTS
  64. $(COPY) $(EXEFILES) $(BINTARGETDIR)
  65. endif
  66. endif
  67. ifdef UNITTARGETDIR
  68. ifdef UNITOBJECTS
  69. $(COPY) $(UNITFILES) $(UNITTARGETDIR)
  70. ifeq ($(SMARTLINK),YES)
  71. $(COPY) $(LIBPREFIX)$(LIBNAME)$(LIBEXT) $(UNITTARGETDIR)
  72. else
  73. $(COPY) $(UNITOFILES) $(UNITTARGETDIR)
  74. endif
  75. endif
  76. endif
  77. install : all
  78. ifdef EXEOBJECTS
  79. $(MKDIR) $(BININSTALLDIR)
  80. $(INSTALLEXE) $(EXEFILES) $(BININSTALLDIR)
  81. endif
  82. ifdef UNITOBJECTS
  83. $(MKDIR) $(UNITINSTALLDIR)
  84. ifeq ($(SMARTLINK),YES)
  85. $(INSTALL) $(LIBPREFIX)$(LIBNAME)$(LIBEXT) $(UNITINSTALLDIR)
  86. else
  87. $(INSTALL) $(UNITFILES) $(UNITOFILES) $(UNITINSTALLDIR)
  88. endif
  89. endif
  90. clean:
  91. -$(DEL) *$(OEXT) *$(ASMEXT) *$(PPUEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) $(PPAS) link.res log
  92. -$(DELTREE) *$(SMARTEXT)
  93. ifdef EXEOBJECTS
  94. -$(DEL) $(EXEFILES)
  95. endif
  96. #####################################################################
  97. # Files
  98. #####################################################################
  99. #####################################################################
  100. # Default makefile targets
  101. #####################################################################
  102. include $(CFG)/makefile.def
  103. #
  104. # $Log$
  105. # Revision 1.7 1998-10-11 12:23:40 michael
  106. # + More sysutils calls.
  107. #
  108. # Revision 1.6 1998/10/02 10:41:08 michael
  109. # Included explicit dependencies for all targets
  110. #
  111. # Revision 1.5 1998/10/02 09:26:02 peter
  112. # * fixed rtl path
  113. #
  114. # Revision 1.4 1998/09/16 16:47:29 peter
  115. # * merged fixes
  116. #
  117. # Revision 1.3 1998/09/15 12:09:12 peter
  118. # * merged updates
  119. #
  120. # Revision 1.2.2.2 1998/09/16 16:17:51 peter
  121. # * updates to install with go32,win32
  122. #
  123. # Revision 1.2.2.1 1998/09/15 12:02:05 peter
  124. # * updates to get objpas using its own makefile
  125. #
  126. # Revision 1.2 1998/09/10 14:15:50 peter
  127. # - renamed makefile to Makefile
  128. #
  129. #