Makefile 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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. # Warning: this file contains TAB (#9) characters that are required for
  16. # make. Make sure you use an editor that does not replace TABs with
  17. # spaces, or the makefile won't work anymore after you save.
  18. #####################################################################
  19. # Defaults
  20. #####################################################################
  21. # Where are the include files
  22. RTL=..
  23. CFG=$(RTL)/cfg
  24. INC=$(RTL)/inc
  25. PROCINC=$(RTL)/$(CPU)
  26. OBJPASDIR=.
  27. # Libname is always objpas
  28. override LIBNAME=objpas
  29. # Don't forget the -S2 switch
  30. override OPT+=-S2
  31. #####################################################################
  32. # Include configuration makefile
  33. #####################################################################
  34. # Get some defaults for Programs and OSes.
  35. # This will set the following variables :
  36. # inlinux COPY REPLACE DEL INSTALL INSTALLEXE MKDIR
  37. # It will also set OPT for cross-compilation, and add required options.
  38. # also checks for config file.
  39. # it expects CFG INC PROCINC to be set !!
  40. include $(CFG)/makefile.cfg
  41. #####################################################################
  42. # Objects
  43. #####################################################################
  44. EXEOBJECTS=
  45. UNITOBJECTS=objpas sysutils math
  46. #####################################################################
  47. # Main targets
  48. #####################################################################
  49. # Create Filenames
  50. EXEFILES=$(addsuffix $(EXEEXT),$(EXEOBJECTS))
  51. UNITFILES=$(addsuffix $(PPUEXT),$(UNITOBJECTS))
  52. UNITOFILES=$(addsuffix $(OEXT),$(UNITOBJECTS))
  53. .PHONY : all clean diffs install diffclean
  54. all : $(EXEFILES) $(UNITFILES) targetdir
  55. $(EXEFILES): %$(EXEEXT): %$(PASEXT)
  56. $(COMPILER) $*
  57. $(UNITFILES): %$(PPUEXT): %$(PASEXT)
  58. $(COMPILER) $*
  59. objpas$(PPUEXT): objpas$(PASEXT) $(INC)/except.inc
  60. # Need to change language file !!
  61. sysutils$(PPUEXT): objpas$(PPUEXT) sysutils$(PASEXT) sysstr.inc sysstrh.inc\
  62. stre.inc syspch.inc syspchh.inc dati.inc datih.inc \
  63. finah.inc fina.inc filutilh.inc
  64. targetdir:
  65. ifdef UNITTARGETDIR
  66. ifdef EXEOBJECTS
  67. $(COPY) $(EXEFILES) $(BINTARGETDIR)
  68. endif
  69. endif
  70. ifdef UNITTARGETDIR
  71. ifdef UNITOBJECTS
  72. $(COPY) $(UNITFILES) $(UNITTARGETDIR)
  73. ifeq ($(SMARTLINK),YES)
  74. $(COPY) $(LIBPREFIX)$(LIBNAME)$(LIBEXT) $(UNITTARGETDIR)
  75. else
  76. $(COPY) $(UNITOFILES) $(UNITTARGETDIR)
  77. endif
  78. endif
  79. endif
  80. install : all
  81. ifdef EXEOBJECTS
  82. $(MKDIR) $(BININSTALLDIR)
  83. $(INSTALLEXE) $(EXEFILES) $(BININSTALLDIR)
  84. endif
  85. ifdef UNITOBJECTS
  86. $(MKDIR) $(UNITINSTALLDIR)
  87. ifeq ($(SMARTLINK),YES)
  88. $(INSTALL) $(LIBPREFIX)$(LIBNAME)$(LIBEXT) $(UNITINSTALLDIR)
  89. else
  90. $(INSTALL) $(UNITFILES) $(UNITOFILES) $(UNITINSTALLDIR)
  91. endif
  92. endif
  93. clean:
  94. -$(DEL) *$(OEXT) *$(ASMEXT) *$(PPUEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) $(PPAS) link.res log
  95. -$(DELTREE) *$(SMARTEXT)
  96. ifdef EXEOBJECTS
  97. -$(DEL) $(EXEFILES)
  98. endif
  99. #####################################################################
  100. # Files
  101. #####################################################################
  102. #####################################################################
  103. # Default makefile targets
  104. #####################################################################
  105. include $(CFG)/makefile.def
  106. #
  107. # $Log$
  108. # Revision 1.8 1998-11-24 19:51:07 jonas
  109. # + added warning about TABs
  110. #
  111. # Revision 1.7 1998/10/11 12:23:40 michael
  112. # + More sysutils calls.
  113. #
  114. # Revision 1.6 1998/10/02 10:41:08 michael
  115. # Included explicit dependencies for all targets
  116. #
  117. # Revision 1.5 1998/10/02 09:26:02 peter
  118. # * fixed rtl path
  119. #
  120. # Revision 1.4 1998/09/16 16:47:29 peter
  121. # * merged fixes
  122. #
  123. # Revision 1.3 1998/09/15 12:09:12 peter
  124. # * merged updates
  125. #
  126. # Revision 1.2.2.2 1998/09/16 16:17:51 peter
  127. # * updates to install with go32,win32
  128. #
  129. # Revision 1.2.2.1 1998/09/15 12:02:05 peter
  130. # * updates to get objpas using its own makefile
  131. #
  132. # Revision 1.2 1998/09/10 14:15:50 peter
  133. # - renamed makefile to Makefile
  134. #
  135. #