Initial revision
[AROS-Contrib.git] / development / compilers / freepascal / rtl / palmos / Makefile
blobf159bafa28000e3ad1b9c4c00a1d26036d98cf70
2 # $Id$
3 # This file is part of the Free Pascal run time library.
4 # Copyright (c) 1999-2000 by Michael van Canneyt
6 # Makefile for the Free Pascal PalmOS Runtime Library
8 # See the file COPYING.FPC, included in this distribution,
9 # for details about the copyright.
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.
16 #####################################################################
17 # Start of configurable section.
18 # Please note that all these must be set in the main makefile, and
19 # should be set there.
20 # Don't remove the indef statements. They serve to avoid conflicts
21 # with the main makefile.
22 #####################################################################
24 # What is the Operating System ?
25 ifndef OS_SOURCE
26 OS_SOURCE=dos
27 endif
29 # What is the target operating system ?
30 ifndef OS_TARGET
31 override OS_TARGET=palmos
32 endif
34 # What compiler to use ?
35 ifndef PP
36 PP=ppc68k
37 endif
39 # What options to pass to the compiler ?
40 # You may want to specify a config file or error definitions file here.
41 ifndef OPT
42 OPT=
43 endif
45 # Use smartlinking ?
46 ifndef SMARTLINK
47 SMARTLINK=NO
48 endif
50 # Name of library ?
51 # If this is set, all units will be put in the same library.
52 # If it is empty (default), the units will be left in separate files.
53 ifndef LIBNAME
54 LIBNAME=
55 #LIBNAME=fpc
56 endif
58 # Should the library be shared or static (only if LIBNAME is set).
59 # Set this to 'shared' or 'static' to create a librrary
60 # Setting this to shared will disable smart linking.
61 ifndef LIBTYPE
62 LIBTYPE=
63 #LIBTYPE=static
64 endif
66 # Where is the PPUMOVE program ?
67 ifndef PPUMOVE
68 PPUMOVE=ppumove
69 endif
71 #####################################################################
72 # End of configurable section.
73 # Do not edit after this line.
74 #####################################################################
75 override OS_TARGET=palmos
76 override CPU=m68k
78 #####################################################################
79 # System independent
80 #####################################################################
82 # Where are the include files
83 RTL=..
84 CFG=$(RTL)/cfg
85 INC=$(RTL)/inc
86 PROCINC=$(RTL)/$(CPU)
87 OBJPASDIR=$(RTL)/objpas
89 # Get some defaults for Programs and OSes.
90 # This will set the following variables :
91 # inlinux indos COPY REPLACE DEL INSTALL INSTALLEXE MKDIR
92 # It will also set OPT for cross-compilation, and add required options.
93 # also checks for config file.
94 # it expects INC PROCINC to be set !!
95 include $(CFG)/makefile.cfg
97 # Get the system independent include file names.
98 # This will set the following variables :
99 # SYSINCNAMES
100 include $(INC)/makefile.inc
101 SYSINCDEPS=$(addprefix $(INC)/,$(SYSINCNAMES))
103 # Get the processor dependent include file names.
104 # This will set the following variables :
105 # CPUINCNAMES
106 include $(PROCINC)/makefile.cpu
107 SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
109 # Put system unit dependencies together.
110 SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
112 #####################################################################
113 # System dependent
114 #####################################################################
116 # Check if we need C library.
117 ifeq ($(LINK_TO_C),YES)
118 override OPT:=$(OPT) -dCRTLIB
119 endif
121 # Define PalmOS units
122 SYSTEMPPU = syspalm.ppu
123 OBJECTS=syspalm
125 PRT=prt0
126 LOADERAS=$(PRT).as
128 # Define Loaders
129 LOADERS=
131 # Add Prefix and Suffixes
132 OBJLOADERS=$(addsuffix $(OEXT), $(LOADERS))
133 PPUOBJECTS=$(addsuffix $(PPUEXT), $(OBJECTS))
135 .PHONY : all install clean \
136 libs libsclean \
137 diffs diffclean \
139 all : $(OBJLOADERS) $(PPUOBJECTS)
141 install : all
142 $(MKDIR) $(UNITINSTALLDIR)
143 $(INSTALL) *$(PPUEXT) *$(OEXT) $(UNITINSTALLDIR)
145 clean :
146 -$(DEL) *$(OEXT) *$(ASMEXT) *$(PPUEXT) *.PPS log
148 #####################################################################
149 # Files
150 #####################################################################
153 # Loaders
156 #prt0$(OEXT) : $(LOADERAS)
157 # -as $(LOADERAS) -o prt0$(OEXT)
159 #gprt0$(OEXT) : $(GLOADERAS)
160 # -as $(GLOADERAS) -o gprt0$(OEXT)
163 # Base Units (System, strings, os-dependent-base-unit)
166 $(SYSTEMPPU) : syspalm.pp $(SYSLINUXDEPS) $(SYSDEPS)
167 $(COMPILER) -Us -Sg syspalm.pp $(REDIR)
169 # strings$(PPUEXT) : ../template/strings.pp $(SYSTEMPPU)
170 # $(COPY) ../template/strings.pp .
171 # $(PP) $(OPT) strings $(REDIR)
172 # $(DEL) strings.pp
175 # Delphi Object Model
178 # objpas$(PPUEXT) : $(OBJPASDIR)/objpas.pp $(SYSTEMPPU)
179 # $(COPY) $(OBJPASDIR)/objpas.pp .
180 # $(PP) $(OPT) objpas $(REDIR)
181 # $(DEL) objpas.pp
184 # System Dependent Units
188 # TP7 Compatible RTL Units
191 #dos$(PPUEXT) : $(DOSDEPS) $(SYSTEMPPU)
192 # $(PP) $(OPT) dos $(REDIR)
194 #crt$(PPUEXT) : crt.pp $(INC)/textrec.inc $(INC)/filerec.inc $(SYSTEMPPU)
195 # $(PP) $(OPT) crt $(REDIR)
197 #objects$(PPUEXT) : $(INC)/objects.pp objinc.inc $(SYSTEMPPU)
198 # $(COPY) $(INC)/objects.pp .
199 # $(PP) $(OPT) objects $(REDIR)
200 # $(DEL) objects.pp
203 # Other RTL Units
206 #####################################################################
207 # Libs
208 #####################################################################
210 staticlib:
211 make clean
212 make all SMARTLINK=YES LIBNAME=fpc LIBTYPE=static
214 sharedlib:
215 make clean
216 make all
217 $(PPUMOVE) -o fpc $(SHAREDLIBFILES)
219 staticlibinstall: staticlib
220 $(MKDIR) $(STATIC_LIBINSTALLDIR)
221 $(MKDIR) $(STATIC_UNITINSTALLDIR)
222 $(INSTALLEXE) libfpc$(STATICLIBEXT) $(STATIC_LIBINSTALLDIR)
223 $(INSTALL) *$(PPUEXT) *$(OEXT) $(STATIC_UNITINSTALLDIR)
225 sharedlibinstall: sharedlib
226 $(MKDIR) $(SHARED_LIBINSTALLDIR)
227 $(MKDIR) $(SHARED_UNITINSTALLDIR)
228 $(INSTALLEXE) libfpc$(SHAREDLIBEXT) $(SHARED_LIBINSTALLDIR)
229 $(INSTALL) *$(PPUEXT) *$(OEXT) $(SHARED_UNITINSTALLDIR)
230 ldconfig
232 libinstall: staticlibinstall sharedlibinstall
234 libsclean : clean
235 -$(DEL) *$(SMARTLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
237 #####################################################################
238 # Default targets
239 #####################################################################
241 include $(CFG)/makefile.def
244 # $Log$
245 # Revision 1.1 2002/02/19 08:26:08 sasu
246 # Initial revision
248 # Revision 1.1 2000/07/13 06:31:10 michael
249 # + Initial import
251 # Revision 1.5 2000/01/07 16:41:50 daniel
252 # * copyright 2000
254 # Revision 1.4 2000/01/07 16:32:34 daniel
255 # * copyright 2000 added
257 # Revision 1.3 1998/10/14 10:31:28 florian
258 # * adapted to work
260 # Revision 1.2 1998/10/02 09:26:03 peter
261 # * fixed rtl path
263 # Revision 1.1 1998/09/10 14:15:51 peter
264 # - renamed makefile to Makefile