Makefile 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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. CFG=../cfg
  20. INC=../inc
  21. PROCINC=../$(CPU)
  22. # Libname is always objpas
  23. override LIBNAME=objpas
  24. # Don't forget the -S2 switch
  25. override OPT+=-S2
  26. #####################################################################
  27. # Include configuration makefile
  28. #####################################################################
  29. # Get some defaults for Programs and OSes.
  30. # This will set the following variables :
  31. # inlinux COPY REPLACE DEL INSTALL INSTALLEXE MKDIR
  32. # It will also set OPT for cross-compilation, and add required options.
  33. # also checks for config file.
  34. # it expects CFG INC PROCINC to be set !!
  35. include $(CFG)/makefile.cfg
  36. #####################################################################
  37. # Objects
  38. #####################################################################
  39. EXEOBJECTS=
  40. UNITOBJECTS=objpas sysutils math
  41. #####################################################################
  42. # Main targets
  43. #####################################################################
  44. # Create Filenames
  45. EXEFILES=$(addsuffix $(EXEEXT),$(EXEOBJECTS))
  46. UNITFILES=$(addsuffix $(PPUEXT),$(UNITOBJECTS))
  47. UNITOFILES=$(addsuffix $(OEXT),$(UNITOBJECTS))
  48. .PHONY : all clean diffs install diffclean
  49. all : $(EXEFILES) $(UNITFILES) targetdir
  50. $(EXEFILES): %$(EXEEXT): %$(PASEXT)
  51. $(COMPILER) $*
  52. $(UNITFILES): %$(PPUEXT): %$(PASEXT)
  53. $(COMPILER) $*
  54. targetdir:
  55. ifdef UNITTARGETDIR
  56. ifdef EXEOBJECTS
  57. $(COPY) $(EXEFILES) $(BINTARGETDIR)
  58. endif
  59. endif
  60. ifdef UNITTARGETDIR
  61. ifdef UNITOBJECTS
  62. $(COPY) $(UNITFILES) $(UNITTARGETDIR)
  63. ifeq ($(SMARTLINK),YES)
  64. $(COPY) $(LIBPREFIX)$(LIBNAME)$(LIBEXT) $(UNITTARGETDIR)
  65. else
  66. $(COPY) $(UNITOFILES) $(UNITTARGETDIR)
  67. endif
  68. endif
  69. endif
  70. install : all
  71. ifdef EXEOBJECTS
  72. $(MKDIR) $(BININSTALLDIR)
  73. $(INSTALLEXE) $(EXEFILES) $(BININSTALLDIR)
  74. endif
  75. ifdef UNITOBJECTS
  76. $(MKDIR) $(UNITINSTALLDIR)
  77. ifeq ($(SMARTLINK),YES)
  78. $(INSTALL) $(LIBPREFIX)$(LIBNAME)$(LIBEXT) $(UNITINSTALLDIR)
  79. else
  80. $(INSTALL) $(UNITFILES) $(UNITOFILES) $(UNITINSTALLDIR)
  81. endif
  82. endif
  83. clean:
  84. -$(DEL) *$(OEXT) *$(ASMEXT) *$(PPUEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) $(PPAS) link.res log
  85. -$(DELTREE) *$(SMARTEXT)
  86. ifdef EXEOBJECTS
  87. -$(DEL) $(EXEFILES)
  88. endif
  89. #####################################################################
  90. # Files
  91. #####################################################################
  92. #####################################################################
  93. # Default makefile targets
  94. #####################################################################
  95. include $(CFG)/makefile.def
  96. #
  97. # $Log$
  98. # Revision 1.4 1998-09-16 16:47:29 peter
  99. # * merged fixes
  100. #
  101. # Revision 1.3 1998/09/15 12:09:12 peter
  102. # * merged updates
  103. #
  104. # Revision 1.2.2.2 1998/09/16 16:17:51 peter
  105. # * updates to install with go32,win32
  106. #
  107. # Revision 1.2.2.1 1998/09/15 12:02:05 peter
  108. # * updates to get objpas using its own makefile
  109. #
  110. # Revision 1.2 1998/09/10 14:15:50 peter
  111. # - renamed makefile to Makefile
  112. #
  113. #