# Makefile targets # ---------------- # # Build gprbuild: make all # Install gprbuild: make install # Create gprbuild package: make distall # Build tool : make # Build libgpr: make libgpr.build # Install libgpr: make libgpr.install # (for libgpr you can add ".type" where type is static, static-pic or shared # build a specific version of the lib. by default all supported variants are # built). # Variables set by configure INSTALL=@INSTALL@ INSTALL_PROGRAM=@INSTALL_PROGRAM@ INSTALL_DATA=@INSTALL_DATA@ IS_WINDOWS=@is_windows@ GNAT_BUILDS_SHARED=@gnat_builds_shared@ ifeq ($(GNAT_BUILDS_SHARED), yes) LIBGPR_TYPES=static shared static-pic else LIBGPR_TYPES=static endif host=@host@ target=@target@ build=@build@ prefix=@prefix@ srcdir=@srcdir@ objdir=@objdir@ exec_prefix=@exec_prefix@ datarootdir=@datarootdir@ datadir=@datadir@ bindir=@bindir@ libdir=@libdir@ libexecdir=@libexecdir@ ifeq ($(IS_WINDOWS),true) EXEXT=.exe else EXEXT= endif CP=cp -p MKDIR=mkdir -p BUILD=production PROCESSORS=0 # target options for cross-build ifeq ($(host),$(target)) GTARGET= else GTARGET=--target=$(target) endif BUILDER=gprbuild -p -m $(GTARGET) -j${PROCESSORS} \ -XOBJDIR=$(objdir) -XBUILD=${BUILD} GPRBUILD_BUILDER=$(BUILDER) -P$(srcdir)/gprbuild -XLIBRARY_TYPE=static LIBGPR_BUILDER=$(BUILDER) -P$(srcdir)/gpr/gpr.gpr LIBGPR_INSTALLER=gprinstall $(srcdir)/gpr/gpr.gpr --prefix=${prefix} -p -f \ -XOBJDIR=$(objdir) --install-name=gpr --build-var=LIBRARY_TYPE $(GTARGET) LIBGPR_UNINSTALLER=gprinstall $(srcdir)/gpr/gpr.gpr --prefix=${prefix} -p -f \ -XOBJDIR=$(objdir) --install-name=gpr --uninstall .PHONY: all distall gprbuild gprconfig gprclean gprinstall gprname gprls all: $(GPRBUILD_BUILDER) distall: all install install.dist gprbuild: $(GPRBUILD_BUILDER) gprbuild-main.adb gprinstall: $(GPRBUILD_BUILDER) gprinstall-main.adb gprclean: $(GPRBUILD_BUILDER) gprclean-main.adb gprconfig: $(GPRBUILD_BUILDER) gprconfig-main.adb gprname: $(GPRBUILD_BUILDER) gprname-main.adb gprls: $(GPRBUILD_BUILDER) gprls-main.adb ################################# # Gprbuild installation targets # ################################# .PHONY: install install.data install.bin install.examples install.docs install.dist install: install.data install.bin install.docs install.examples install.data: -${MKDIR} ${datadir}/gprconfig ${CP} $(srcdir)/share/gprconfig/*.xml ${datadir}/gprconfig ${CP} $(srcdir)/share/gprconfig/gprconfig.xsd ${datadir}/gprconfig -${MKDIR} ${datadir}/gpr ${CP} $(srcdir)/share/_default.gpr ${datadir}/gpr install.bin: -${MKDIR} ${bindir} ${INSTALL_PROGRAM} $(objdir)/exe/gprconfig${EXEXT} ${bindir} ${INSTALL_PROGRAM} $(objdir)/exe/gprbuild${EXEXT} ${bindir} ${INSTALL_PROGRAM} $(objdir)/exe/gprclean${EXEXT} ${bindir} ${INSTALL_PROGRAM} $(objdir)/exe/gprinstall${EXEXT} ${bindir} ifeq ($(IS_WINDOWS),true) ${CP} $(srcdir)/src/gprinstall.exe.manifest ${bindir} chmod +x ${bindir}/gprinstall.exe.manifest endif ${INSTALL_PROGRAM} $(objdir)/exe/gprname${EXEXT} ${bindir} ${INSTALL_PROGRAM} $(objdir)/exe/gprslave${EXEXT} ${bindir} ${INSTALL_PROGRAM} $(objdir)/exe/gprls${EXEXT} ${bindir} -${MKDIR} ${libexecdir}/gprbuild ${INSTALL_PROGRAM} $(objdir)/exe/gprbind${EXEXT} ${libexecdir}/gprbuild/ ${INSTALL_PROGRAM} $(objdir)/exe/gprlib${EXEXT} ${libexecdir}/gprbuild/ install.examples: -${MKDIR} ${datadir}/gpr $(RM) -r ${datadir}/examples/gprbuild -${MKDIR} ${datadir}/examples/gprbuild ${CP} -r $(srcdir)/examples/* ${datadir}/examples/gprbuild install.docs: ${RM} -r ${datadir}/doc/gprbuild -${MKDIR} ${datadir}/doc/gprbuild for format in html txt pdf info; do \ if [ -d $(srcdir)/doc/$$format ] ; then \ ${MKDIR} ${datadir}/doc/gprbuild/$$format; \ if [ $$format = html ] ; then \ ${CP} -r $(srcdir)/doc/$$format/* ${datadir}/doc/gprbuild/$$format; \ ${CP} $(srcdir)/doc/*.png ${datadir}/doc/gprbuild/html; \ sed -e "s/.*//" $(srcdir)/doc/gprbuild_gps.xml \ > ${datadir}/doc/gprbuild/html/gps_index.xml; \ else \ ${CP} $(srcdir)/doc/$$format/*.$$format ${datadir}/doc/gprbuild/$$format; \ fi; \ fi; \ done install.dist: if [ "$(IS_WINDOWS)" = "false" ]; then \ $(CP) $(srcdir)/doinstall $(prefix) && \ chmod a+x $(prefix)/doinstall; \ fi ifeq ($(BUILD), production) strip $(prefix)/bin/gprbuild$(EXEXT) strip $(prefix)/bin/gprclean$(EXEXT) strip $(prefix)/bin/gprconfig$(EXEXT) strip $(prefix)/bin/gprinstall$(EXEXT) strip $(prefix)/bin/gprname$(EXEXT) strip $(prefix)/bin/gprslave$(EXEXT) strip $(prefix)/bin/gprls$(EXEXT) strip $(prefix)/libexec/gprbuild/gprbind$(EXEXT) strip $(prefix)/libexec/gprbuild/gprlib$(EXEXT) endif complete: all install libgpr.install.static ########## # Libgpr # ########## .PHONY: libgpr.build libgpr.build.static libgpr.build.shared libgpr.build.static-pic .PHONY: libgpr.install libgpr.install.static libgpr.install.shared libgpr.install.static-pic .PHONY: libgpr.uninstall libgpr.build: $(foreach t, $(LIBGPR_TYPES), libgpr.build.$(t)) libgpr.build.shared: ${BUILDER} -XLIBRARY_TYPE=relocatable -P$(srcdir)/gpr/gpr.gpr libgpr.build.static: ${BUILDER} -XLIBRARY_TYPE=static -P$(srcdir)/gpr/gpr.gpr libgpr.build.static-pic: ${BUILDER} -XLIBRARY_TYPE=static-pic -P$(srcdir)/gpr/gpr.gpr libgpr.install: $(foreach t, $(LIBGPR_TYPES), libgpr.install.$(t)) libgpr.install.static: $(LIBGPR_INSTALLER) \ -XLIBRARY_TYPE=static \ --lib-subdir=lib/gpr/static \ --build-name=static libgpr.install.static-pic: $(LIBGPR_INSTALLER) \ -XLIBRARY_TYPE=static-pic \ --lib-subdir=lib/gpr/static-pic \ --build-name=static-pic libgpr.install.shared: $(LIBGPR_INSTALLER) \ -XLIBRARY_TYPE=relocatable \ --lib-subdir=lib/gpr/relocatable \ --build-name=relocatable libgpr.uninstall: -$(LIBGPR_UNINSTALLER) ################### # Cleanup targets # ################### .PHONY: clean distclean clean: -gprclean -q -r -XOBJDIR=$(objdir) -P$(srcdir)/gprbuild -XBUILD=$(BUILD) -gprclean -q -r -XOBJDIR=$(objdir) -XBUILD=${BUILD} -XLIBRARY_TYPE=relocatable -P$(srcdir)/gpr/gpr.gpr -gprclean -q -r -XOBJDIR=$(objdir) -XBUILD=${BUILD} -XLIBRARY_TYPE=static-pic -P$(srcdir)/gpr/gpr.gpr -gprclean -q -r -XOBJDIR=$(objdir) -XBUILD=${BUILD} -XLIBRARY_TYPE=static -P$(srcdir)/gpr/gpr.gpr ifeq ($(GNAT_BUILDS_SHARED), yes) gprclean -q -Pgpr/gpr.gpr -XBUILD=$(BUILD) -XLIBRARY_TYPE=relocatable endif distclean: clean @${RM} config.log config.status src/gprconfig-sdefault.ads @${RM} Makefile make -C doc clean make -C examples clean .PHONY: doc tests examples doc: make -C doc tests: force cd internal/gprtests_python; python ./run-gprconfig-test.py cd internal/gprtests_python; python ./run-gprbuild-test.py .PHONY: copy_gnat_src GNAT_SOURCE_DIR=../gnat_src copy_gnat_src: -cd gnat; \ $(foreach f,$(shell cat gnat/MANIFEST.GPRBUILD), \ $(LN) $(GNAT_SOURCE_DIR)/$(f) . ;) ###################### # 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: