File: Makefile.in

package info (click to toggle)
gprbuild 2011-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 10,396 kB
  • sloc: ada: 94,726; sh: 2,818; xml: 2,225; makefile: 471; ansic: 240; cpp: 89; fortran: 62; asm: 27
file content (231 lines) | stat: -rw-r--r-- 6,327 bytes parent folder | download
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
SHELL=/bin/sh
INSTALL=@INSTALL@
INSTALL_PROGRAM=@INSTALL_PROGRAM@
INSTALL_DATA=@INSTALL_DATA@
host=@host@
target=@target@
build=@build@
IS_WINDOWS=@is_windows@

# Relative to the gnat/ subdirectory (or absolute path)
GNAT_SOURCE_DIR=../gnat_src

ifeq ($(IS_WINDOWS),true)
LN=cp -p
EXEXT=.exe
else
LN=ln -s -f
EXEXT=
endif
CP=cp -p
MKDIR=mkdir -p
BUILD=debug

prefix=@prefix@
srcdir=@srcdir@
root_objdir=@objdir@
exec_prefix=@exec_prefix@
datarootdir=@datarootdir@
datadir=@datadir@
bindir=@bindir@
libdir=@libdir@
libexecdir=@libexecdir@
docdir=${datadir}/doc/@PACKAGE_TARNAME@

# Are xmlada sources in our source tree
xmlada_build_target=@xmlada_build_target@
xmlada_prj_flags=@xmlada_prj_flags@

# How do we want to use XML/Ada ?
LIBRARY_TYPE=static
export LIBRARY_TYPE

# What is the default debug mode ?
DEBUG_MODE=debug

objdir=obj
ifeq ($(BUILD), debug)
objdir=obj-debug
endif
ifeq ($(BUILD), coverage)
objdir=obj-cov
endif
ifeq ($(BUILD), profiling)
objdir=obj-prof
endif

dummy:=$(shell $(MKDIR) $(objdir))

PROCESSORS ?= 1

GNATMAKE=gnatmake -p -m -j${PROCESSORS}
ifeq ($(strip $(filter-out %vms%,$(host))),)
GNATMAKE=${GNATMAKE} -XOS=vms
endif

ADA_GEN_SUBDIR=gnat

.PHONY: all distall gprbuild gprconfig gprclean copy_gnat_src complete bootstrap
all: $(xmlada_build_target) $(ADA_GEN_SUBDIR)/stamp-snames
	${GNATMAKE} $(xmlada_prj_flags) -Pgprbuild -XBUILD=${BUILD}

distall:
	make GNATMAKE="$(GNATMAKE)" BUILD="$(DEBUG_MODE)"
	make BUILD="$(DEBUG_MODE)" install
	mv $(prefix)/bin/gprconfig$(EXEXT) $(prefix)/bin/gprconfig_debug$(EXEXT)
	mv $(prefix)/bin/gprclean$(EXEXT) $(prefix)/bin/gprclean_debug$(EXEXT)
	mv $(prefix)/bin/gprbuild$(EXEXT) $(prefix)/bin/gprbuild_debug$(EXEXT)
	make GNATMAKE="$(GNATMAKE)" BUILD=production
	make BUILD=production install
	if [ "$(IS_WINDOWS)" = "false" ]; then \
	  $(CP) $(srcdir)/doinstall $(prefix) && \
	  chmod a+x $(prefix)/doinstall; \
	fi
	strip $(prefix)/bin/gprbuild$(EXEXT)
	strip $(prefix)/bin/gprclean$(EXEXT)
	strip $(prefix)/bin/gprconfig$(EXEXT)
	strip $(prefix)/libexec/gprbuild/gprbind$(EXEXT)
	strip $(prefix)/libexec/gprbuild/gprlib$(EXEXT)

all gprconfig gprbuild gprclean: $(objdir)/gprbuild_dummies.o $(objdir)/link.o force

MOVE_IF_CHANGE=mv -f
-include $(srcdir)/gnat/Make-generated.in

copy_gnat_src: force
	-cd $(ADA_GEN_SUBDIR); \
	$(foreach f,$(shell cat $(ADA_GEN_SUBDIR)/MANIFEST.GPRBUILD), \
	    $(LN) $(GNAT_SOURCE_DIR)/$(f) . ;\
           )

complete: copy_gnat_src all install

gprbuild gprclean:
	${GNATMAKE} -Pgprbuild -XBUILD=${BUILD} $@

gprconfig:
	${GNATMAKE} -Pgprbuild -XBUILD=${BUILD} gprconfig-main

bootstrap: gprconfig gprbuild
	echo
	echo "=== Bootstraping grpbuild"
	make install prefix=bootstrap/install
	-${MKDIR} bootstrap/${objdir}
	bootstrap/install/bin/gprbuild -Pgprbuild -XBUILD=${BUILD} \
	  -XBUILD_TOOL=gprbuild

.PHONY: install clean distclean bootstrap-clean

bootstrap-clean:
	bootstrap/install/bin/gprclean -Pgprbuild -XBUILD=${BUILD} \
	  -XBUILD_TOOL=gprbuild

install: install.data install.bin
	-${MKDIR} ${datadir}/gpr
	$(RM) -r ${datadir}/examples/gprbuild
	-${MKDIR} ${datadir}/examples/gprbuild
	${CP} -r examples/* ${datadir}/examples/gprbuild
	${RM} -r ${datadir}/doc/gprbuild
	-${MKDIR} ${datadir}/doc/gprbuild
	for format in html txt pdf info; do \
	  if [ -d doc/$$format ] ; then \
	     ${MKDIR} ${datadir}/doc/gprbuild/$$format; \
	     ${CP} doc/$$format/* ${datadir}/doc/gprbuild/$$format; \
	     if [ $$format = html ] ; then \
	        ${CP} doc/*.png ${datadir}/doc/gprbuild/html; \
	        sed -e "s/<doc_path>.*//" doc/gprbuild_gps.xml \
	           > ${datadir}/doc/gprbuild/html/gps_index.xml; \
	     fi; \
	  fi; \
	done

install.data: force
	-${MKDIR} ${datadir}/gprconfig
	${CP} share/gprconfig/*.xml ${datadir}/gprconfig

install.bin: force
	-${MKDIR} ${bindir}
	${INSTALL_PROGRAM} gprconfig${EXEXT} ${bindir}
	${INSTALL_PROGRAM} gprbuild${EXEXT} ${bindir}
	${INSTALL_PROGRAM} gprclean${EXEXT} ${bindir}
	-${MKDIR} ${libexecdir}/gprbuild
	${INSTALL_PROGRAM} gprbind${EXEXT} ${libexecdir}/gprbuild/
	${INSTALL_PROGRAM} gprlib${EXEXT} ${libexecdir}/gprbuild/

$(objdir)/gprbuild_dummies.o: src/gprbuild_dummies.c
	gcc -c -o $@ $<

$(objdir)/link.o: gnat/link.c
	gcc -c -o $@ $<

.PHONY: build_xmlada
build_xmlada:
	cd $(srcdir)/xmlada && ./configure --build=$(build) \
	  --prefix=$(root_objdir)/xmlada/install 
	cd $(srcdir)/xmlada && make LIBRARY_TYPE=static static install_static

clean:
	gnat clean -q -r -Pgprbuild

distclean:
	gnat clean -q -r -Pgprbuild
	@${RM} config.log config.status src/gprconfig-sdefault.ads
	@${RM} Makefile
	@${RM} $(objdir)/*
	@${RM} -r bootstrap
	make -C doc clean
	make -C examples clean

.PHONY: doc install-doc tests examples force
doc:
	make -C doc

install-doc:
	-$(MKDIR) ${docdir}/html
	${CP} doc/*.html ${docdir}/html

tests: force
	cd internal/gprtests_python; python ./run-gprconfig-test.py
	cd internal/gprtests_python; python ./run-gprbuild-test.py

######################
# Running tests locally
# Run tests with the locally compiled gprbuild (no "make install" necessary)
# You can set test_names and test_config from the command line to restrict
# the tests that are run. When running all the tests, only show the failing
# tests to make them more obvious. But when running a specific set of tests,
# display all results.
# Adds "~/.local/bin" to the PATH, in case gnatpython was installed with --user.
# Adds "." to the PATH, since some of the tests expect it.
######################

test_names=
test_config=

ifneq (${test_config},)
test_config_switch:=--config=${test_config}
else
test_config_switch=
endif

LOCAL_SETUP = cd internal/gprtests_python; PATH=${HOME}/.local/bin:${shell pwd}/install/bin:${PATH}:.

LOCAL_GPRCONFIG_TEST=${LOCAL_SETUP}; python ./run-gprconfig-test.py --diffs --enable-color -j${PROCESSORS} ${test_config_switch}

LOCAL_GPRBUILD_TEST=${LOCAL_SETUP}; python ./run-gprbuild-test.py --diffs --enable-color -j${PROCESSORS} ${test_config_switch}

install_local: force
	@make prefix=${shell pwd}/install install

tests_local: install_local
ifeq (${test_names},)
	@${LOCAL_GPRCONFIG_TEST} --loglevel=ERROR
	@${LOCAL_GPRBUILD_TEST} --loglevel=ERROR
else
	@${LOCAL_GPRCONFIG_TEST} --loglevel=INFO ${test_names}
	@${LOCAL_GPRBUILD_TEST} --loglevel=INFO ${test_names}
endif

examples: force
	make -C examples
force: