PageRenderTime 29ms CodeModel.GetById 17ms app.highlight 10ms RepoModel.GetById 0ms app.codeStats 0ms

/packages/fcl-async/Makefile.fpc

https://github.com/slibre/freepascal
Unknown | 89 lines | 82 code | 7 blank | 0 comment | 0 complexity | e66161529a16e01aeafe563214e555f4 MD5 | raw file
Possible License(s): LGPL-2.0, LGPL-2.1, LGPL-3.0
 1#
 2#   Makefile.fpc for running fpmake
 3#
 4
 5[package]
 6name=fcl-async
 7version=2.7.1
 8
 9[require]
10packages=rtl fpmkunit
11
12[install]
13fpcpackage=y
14
15[default]
16fpcdir=../..
17
18[prerules]
19FPMAKE_BIN_CLEAN=$(wildcard .$(PATHSEP)fpmake$(SRCEXEEXT))
20ifdef OS_TARGET
21FPC_TARGETOPT+=--os=$(OS_TARGET)
22endif
23ifdef CPU_TARGET
24FPC_TARGETOPT+=--cpu=$(CPU_TARGET)
25endif
26LOCALFPMAKE=.$(PATHSEP)fpmake$(SRCEXEEXT)
27
28[rules]
29# Do not pass the Makefile's unit and binary target locations. fpmake uses it's own.
30override FPCOPT:=$(filter-out -FU%,$(FPCOPT))
31override FPCOPT:=$(filter-out -FE%,$(FPCOPT))
32# Compose general fpmake-parameters
33ifdef FPMAKEOPT
34FPMAKE_OPT+=$(FPMAKEOPT)
35endif
36FPMAKE_OPT+=--localunitdir=../..
37FPMAKE_OPT+=--globalunitdir=..
38FPMAKE_OPT+=$(FPC_TARGETOPT)
39FPMAKE_OPT+=$(addprefix -o ,$(FPCOPT))
40FPMAKE_OPT+=--compiler=$(FPC)
41FPMAKE_OPT+=-bu
42.NOTPARALLEL:
43
44fpmake: fpmake.pp
45	$(FPCFPMAKE) fpmake.pp $(FPMAKE_SKIP_CONFIG) $(addprefix -Fu,$(COMPILER_FPMAKE_UNITDIR)) $(FPCMAKEOPT) $(OPT)
46all:	fpmake
47	$(LOCALFPMAKE) compile $(FPMAKE_OPT)
48smart:	fpmake
49	$(LOCALFPMAKE) compile $(FPMAKE_OPT) -o -XX -o -CX
50release:	fpmake
51	$(LOCALFPMAKE) compile $(FPMAKE_OPT) -o -dRELEASE
52debug:	fpmake
53	$(LOCALFPMAKE) compile $(FPMAKE_OPT) -o -dDEBUG
54# If no fpmake exists and (dist)clean is called, do not try to build fpmake, it will
55# most often fail because the dependencies are cleared.
56# In case of a clean, simply do nothing
57ifeq ($(FPMAKE_BIN_CLEAN),)
58clean:
59else
60clean:
61	$(FPMAKE_BIN_CLEAN) clean $(FPMAKE_OPT)
62endif
63# In case of a distclean, perform an 'old'-style distclean. This to avoid problems
64# when the package is compiled using fpcmake prior to running this clean using fpmake
65ifeq ($(FPMAKE_BIN_CLEAN),)
66distclean:	$(addsuffix _distclean,$(TARGET_DIRS)) fpc_cleanall
67else
68distclean:
69ifdef inUnix
70        { $(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;  }
71else
72        $(FPMAKE_BIN_CLEAN) distclean $(FPMAKE_OPT)
73endif
74	-$(DEL) $(LOCALFPMAKE)
75endif
76cleanall: distclean
77install:	fpmake
78ifdef UNIXHier
79	$(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_PREFIX) --baseinstalldir=$(INSTALL_LIBDIR)/fpc/$(FPC_VERSION) --unitinstalldir=$(INSTALL_UNITDIR)
80else
81	$(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_BASEDIR) --unitinstalldir=$(INSTALL_UNITDIR)
82endif
83# distinstall also installs the example-sources
84distinstall:	fpmake
85ifdef UNIXHier
86	$(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_PREFIX) --baseinstalldir=$(INSTALL_LIBDIR)/fpc/$(FPC_VERSION) --unitinstalldir=$(INSTALL_UNITDIR) -ie
87else
88	$(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_BASEDIR)  --unitinstalldir=$(INSTALL_UNITDIR) -ie
89endif