File: Makefile.fpc

package info (click to toggle)
fpc 3.2.2%2Bdfsg-49
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 341,452 kB
  • sloc: pascal: 3,820,194; xml: 194,356; ansic: 9,637; asm: 8,482; java: 5,346; sh: 4,813; yacc: 3,956; makefile: 2,705; lex: 2,661; javascript: 2,454; sql: 929; php: 474; cpp: 145; perl: 136; sed: 132; csh: 34; tcl: 7
file content (184 lines) | stat: -rw-r--r-- 6,019 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
#
#   Makefile.fpc for running fpmake
#
[package]
name=ide
version=3.2.2

[target]
dirs=fakegdb compiler

[require]
packages=rtl fpmkunit rtl-extra fv chm regexpr
packages_go32v2=graph

[install]
fpcpackage=y
fpcsubdir=ide

[default]
fpcdir=../..

[prerules]
# Translate INSTALL_UNITDIR to fpmake's --unitinstalldir parameter
ifdef INSTALL_UNITDIR
FPMAKE_INSTALL_OPT+=--unitinstalldir=$(INSTALL_UNITDIR)
endif
ifdef INSTALL_BINDIR
FPMAKE_INSTALL_OPT+=--bininstalldir=$(INSTALL_BINDIR)
endif

# Translate OS_TARGET and CPU_TARGET to fpmake's --os and --cpu parameters
ifdef OS_TARGET
FPC_TARGETOPT+=--os=$(OS_TARGET)
endif
ifdef CPU_TARGET
FPC_TARGETOPT+=--cpu=$(CPU_TARGET)
endif
FPMAKE_BIN_CLEAN=$(wildcard ./fpmake$(SRCEXEEXT))
LOCALFPMAKE=./fpmake$(SRCEXEEXT)
# do not add -d$(CPU_TARGET)
override NOCPUDEF=1
# This list should be the same as in fpcbuild/Makefile.fpc and in fpcsrc/Makefile.fpc
GDBMI_DEFAULT_OS_LIST=aix darwin freebsd haiku linux netbsd openbsd solaris win32 win64

[rules]
# Do not pass the Makefile's unit and binary target locations. Fpmake uses it's own.
override FPCOPT:=$(filter-out -FU%,$(FPCOPT))
override FPCOPT:=$(filter-out -FE%,$(FPCOPT))
# Do not pass the package-unitdirectories. Fpmake adds those and this way they don't apear in the .fpm
override FPCOPT:=$(filter-out $(addprefix -Fu,$(COMPILER_UNITDIR)),$(FPCOPT))# Compose general fpmake-parameters
# Compose general fpmake-parameters
ifdef FPMAKEOPT
FPMAKE_OPT+=$(FPMAKEOPT)
endif
FPMAKE_OPT+=--localunitdir=../..
FPMAKE_OPT+=--globalunitdir=../../packages
FPMAKE_OPT+=$(FPC_TARGETOPT)
FPMAKE_OPT+=$(addprefix -o ,$(FPCOPT))
FPMAKE_OPT+=--compiler=$(FPC)
FPMAKE_OPT+=-bu
ifdef NOGDB
FPMAKE_OPT+=--NoGDB=1
else
ifndef NOGDBMI
ifneq ($(findstring $(OS_TARGET),$(GDBMI_DEFAULT_OS_LIST)),)
GDBMI=1
endif
endif # NOGDBMI

ifdef NOGDBMI
FPMAKE_OPT+=--NOGDBMI=1
endif

ifdef GDBMI
FPMAKE_OPT+=--GDBMI=1
# If the rtl does not require libc, then
# IDE compiled with GDBMI should be a static executable
# and can thus be cross-compiled
ifeq ($(findstring $(OS_TARGET),aix beos darwin haiku solaris),)
GDBMI_IS_STATIC=1
endif
endif
endif # NOGDB

ifndef GDBMI_IS_STATIC
ifndef BUILDFULLNATIVE
# Omit executable is only required if generated executable is not static
FPMAKE_OPT+=-scp
endif
endif # GDBMI_IS_STATIC

ifdef PPC_TARGET
FPMAKE_OPT+=--CompilerTarget=$(PPC_TARGET)
endif

.NOTPARALLEL:

PPC_TARGETS=i386 m68k powerpc sparc arm x86_64 powerpc64 mips mipsel avr jvm i8086 aarch64 sparc64
CLEAN_TARGETS=$(addsuffix _clean,$(sort $(PPC_TARGETS)))
DISTCLEAN_TARGETS=$(addsuffix _distclean,$(sort $(PPC_TARGETS)))
INSTALL_TARGETS=$(addsuffix _exe_install,$(sort $(PPC_TARGETS)))
.PHONY: $(PPC_TARGETS) $(CLEAN_TARGETS) $(DISTCLEAN_TARGETS) $(INSTALL_TARGETS)

$(PPC_TARGETS):
        $(MAKE) PPC_TARGET=$@ all

$(CLEAN_TARGETS):
        $(MAKE) clean PPC_TARGET=$(subst _clean,,$@)

$(DISTCLEAN_TARGETS):
        $(MAKE) distclean PPC_TARGET=$(subst _distclean,,$@)

$(INSTALL_TARGETS):
        $(MAKE) all install PPC_TARGET=$(subst _exe_install,,$@)

all_targets: $(PPC_TARGETS)

all_targets_install: $(INSTALL_TARGETS)


fpmake$(SRCEXEEXT): fpmake.pp
	$(FPCFPMAKE) fpmake.pp $(FPMAKE_SKIP_CONFIG) $(addprefix -Fu,$(COMPILER_FPMAKE_UNITDIR)) $(FPCMAKEOPT) $(OPT)
all:	fpmake$(SRCEXEEXT)
	$(LOCALFPMAKE) compile $(FPMAKE_OPT)
smart:	fpmake$(SRCEXEEXT)
	$(LOCALFPMAKE) compile $(FPMAKE_OPT) -o -XX -o -CX
release:	fpmake$(SRCEXEEXT)
	$(LOCALFPMAKE) compile $(FPMAKE_OPT) -o -dRELEASE
debug:	fpmake$(SRCEXEEXT)
	$(LOCALFPMAKE) compile $(FPMAKE_OPT) -o -dDEBUG
# If no fpmake exists and (dist)clean is called, do not try to build fpmake, it will
# most often fail because the dependencies are cleared.
# In case of a clean, simply do nothing
ifeq ($(FPMAKE_BIN_CLEAN),)
clean:
else
clean:
	$(FPMAKE_BIN_CLEAN) clean $(FPMAKE_OPT)
endif

CLEAN_TARGET_DIRS=$(subst /Makefile.fpc, ,$(wildcard */Makefile.fpc))
%_distclean:
	$(MAKE) -C $* distclean

# In case of a distclean, perform an 'old'-style distclean. This to avoid problems
# when the package is compiled using fpcmake prior to running this clean using fpmake
ifeq ($(FPMAKE_BIN_CLEAN),)
distclean:	fpc_cleanall $(addsuffix _distclean,$(CLEAN_TARGET_DIRS))
else
distclean:
ifdef inUnix
        { $(FPMAKE_BIN_CLEAN) distclean $(FPMAKE_OPT); if [ $$? != "0" ]; then { echo Something wrong with fpmake exectable. Remove the executable and call make recursively to recover.; $(DEL) $(FPMAKE_BIN_CLEAN); $(MAKE) fpc_cleanall; }; fi;  }
else
        $(FPMAKE_BIN_CLEAN) distclean $(FPMAKE_OPT)
endif
	-$(DEL) $(LOCALFPMAKE)
	-$(DEL) fpmake.o
	-$(DEL) fpmake.dbg
endif
cleanall: distclean
install:	fpmake$(SRCEXEEXT)
ifdef UNIXHier
	$(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_PREFIX) --baseinstalldir=$(INSTALL_LIBDIR)/fpc/$(FPC_VERSION) $(FPMAKE_INSTALL_OPT)
else
	$(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_BASEDIR) --baseinstalldir=$(INSTALL_BASEDIR) $(FPMAKE_INSTALL_OPT)
endif
# distinstall also installs the example-sources and omits the location of the source-
# files from the fpunits.cfg files.
distinstall:	fpmake$(SRCEXEEXT)
ifdef UNIXHier
	$(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_PREFIX) --baseinstalldir=$(INSTALL_LIBDIR)/fpc/$(FPC_VERSION) $(FPMAKE_INSTALL_OPT) -ie -fsp 0
else
	$(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_BASEDIR) --baseinstalldir=$(INSTALL_BASEDIR) $(FPMAKE_INSTALL_OPT) -ie -fsp 0
endif
zipinstall:	fpmake$(SRCEXEEXT)
	$(LOCALFPMAKE) zipinstall $(FPMAKE_OPT) --zipprefix=$(DIST_DESTDIR)/$(ZIPPREFIX)
zipdistinstall:	fpmake$(SRCEXEEXT)
	$(LOCALFPMAKE) zipinstall $(FPMAKE_OPT) --zipprefix=$(DIST_DESTDIR)/$(ZIPPREFIX) -ie -fsp 0
zipsourceinstall:	fpmake$(SRCEXEEXT)
ifdef UNIXHier
	$(LOCALFPMAKE) archive $(FPMAKE_OPT) --zipprefix=$(DIST_DESTDIR)/$(ZIPPREFIX) --prefix=share/src/fpc-\$$\(PACKAGEVERSION\)/$(INSTALL_FPCSUBDIR)/\$$\(PACKAGEDIRECTORY\)
else
	$(LOCALFPMAKE) archive $(FPMAKE_OPT) --zipprefix=$(DIST_DESTDIR)/$(ZIPPREFIX) --prefix=source\\$(INSTALL_FPCSUBDIR)\\\$$\(PACKAGEDIRECTORY\)
endif