You've already forked templates-parser
mirror of
https://github.com/AdaCore/templates-parser.git
synced 2026-02-12 12:29:55 -08:00
Clarify variables flow.
Prevent build-doc to compile the library again into .build/obj, because without -subdir .build/obj/TARGET/MODE/static is not seen. No need to recompute SDIR in regtests/Makefile, it is set in makefile.setup. Remove duplicate PRJ_BUILD in ALL_OPTIONS. Avoid undefined VERSION in templates_parser.gpr when building examples.
This commit is contained in:
committed by
Pascal Obry
parent
c1743922dc
commit
e68fb7ab05
57
Makefile
57
Makefile
@@ -98,18 +98,26 @@ ifeq ($(TP_XMLADA),)
|
||||
TP_XMLADA=Disabled
|
||||
endif
|
||||
|
||||
ALL_OPTIONS = INCLUDES="$(INCLUDES)" PRJ_BUILD="$(PRJ_BUILD)" SDIR="$(SDIR)" \
|
||||
TP_XMLADA="$(TP_XMLADA)" GNAT="$(GNAT)" \
|
||||
PRJ_BUILD="$(PRJ_BUILD)" TARGET="$(TARGET)" \
|
||||
DEFAULT_LIBRARY_TYPE="$(DEFAULT_LIBRARY_TYPE)" \
|
||||
ENABLE_SHARED="$(ENABLE_SHARED)" \
|
||||
ENABLE_STATIC="$(ENABLE_STATIC)" \
|
||||
GPRBUILD="$(GPRBUILD)" GPRCLEAN="$(GPRCLEAN)" \
|
||||
VERSION="$(VERSION)"
|
||||
ALL_OPTIONS := \
|
||||
DEBUG \
|
||||
DEFAULT_LIBRARY_TYPE \
|
||||
ENABLE_SHARED \
|
||||
ENABLE_STATIC \
|
||||
GNAT \
|
||||
GPRBUILD \
|
||||
GPRCLEAN \
|
||||
INCLUDES \
|
||||
PRJ_BUILD \
|
||||
PROCESSORS \
|
||||
SDIR \
|
||||
TARGET \
|
||||
TP_XMLADA \
|
||||
VERSION \
|
||||
prefix \
|
||||
|
||||
GPROPTS += -XPRJ_BUILD=$(PRJ_BUILD) -XTP_XMLADA=$(TP_XMLADA) \
|
||||
-XPROCESSORS=$(PROCESSORS) -XTARGET=$(TARGET) \
|
||||
-XVERSION=$(VERSION)
|
||||
GPROPTS += $(foreach v, \
|
||||
PRJ_BUILD TP_XMLADA PROCESSORS TARGET VERSION \
|
||||
,"-X$(v)=$($(v))")
|
||||
|
||||
GPR_DEFAULT = -XLIBRARY_TYPE=$(DEFAULT_LIBRARY_TYPE) \
|
||||
-XXMLADA_BUILD=$(DEFAULT_LIBRARY_TYPE)
|
||||
@@ -119,7 +127,7 @@ GPR_OTHER = -XLIBRARY_TYPE=$(OTHER_LIBRARY_TYPE) \
|
||||
#######################################################################
|
||||
# build
|
||||
|
||||
build: tp_xmlada.gpr
|
||||
build: tp_xmlada.gpr makefile.setup
|
||||
$(GPRBUILD) -p $(GPROPTS) $(GPR_DEFAULT) \
|
||||
--subdirs=$(SDIR)/$(DEFAULT_LIBRARY_TYPE) -Ptemplates_parser
|
||||
ifneq ($(OTHER_LIBRARY_TYPE),)
|
||||
@@ -129,33 +137,26 @@ endif
|
||||
$(GPRBUILD) -p $(GPROPTS) $(GPR_DEFAULT) \
|
||||
--subdirs=$(SDIR)/$(DEFAULT_LIBRARY_TYPE) -Ptools/tools
|
||||
|
||||
run_regtests test: build
|
||||
$(MAKE) -C regtests $(ALL_OPTIONS) test
|
||||
run_regtests test: build makefile.setup
|
||||
$(MAKE) -C regtests test
|
||||
|
||||
DOC_FORMATS := html latexpdf
|
||||
build-doc: tp_xmlada.gpr
|
||||
build-doc: tp_xmlada.gpr makefile.setup
|
||||
$(MAKE) -C docs $(DOC_FORMATS)
|
||||
echo Templates_Parser Documentation built with success.
|
||||
|
||||
#######################################################################
|
||||
# setup
|
||||
|
||||
tp_xmlada.gpr: setup
|
||||
|
||||
setup:
|
||||
tp_xmlada.gpr:
|
||||
ifeq ($(TP_XMLADA), Installed)
|
||||
cp config/tp_xmlada_installed.gpr tp_xmlada.gpr
|
||||
else
|
||||
cp config/tp_xmlada_dummy.gpr tp_xmlada.gpr
|
||||
endif
|
||||
echo "prefix=$(prefix)" > makefile.setup
|
||||
echo "DEFAULT_LIBRARY_TYPE=$(DEFAULT_LIBRARY_TYPE)" >> makefile.setup
|
||||
echo "ENABLE_STATIC=$(ENABLE_STATIC)" >> makefile.setup
|
||||
echo "ENABLE_SHARED=$(ENABLE_SHARED)" >> makefile.setup
|
||||
echo "DEBUG=$(DEBUG)" >> makefile.setup
|
||||
echo "PROCESSORS=$(PROCESSORS)" >> makefile.setup
|
||||
echo "TP_XMLADA=$(TP_XMLADA)" >> makefile.setup
|
||||
echo "TARGET=$(TARGET)" >> makefile.setup
|
||||
|
||||
setup makefile.setup:
|
||||
echo " $(foreach v,$(ALL_OPTIONS),$(v) := $($(v))\n)" > $@
|
||||
|
||||
#######################################################################
|
||||
# install
|
||||
@@ -189,7 +190,7 @@ clean:
|
||||
ifneq ($(OTHER_LIBRARY_TYPE),)
|
||||
-$(GPRCLEAN) $(GPR_OTHER) $(GPROPTS) -Ptemplates_parser
|
||||
endif
|
||||
-$(MAKE) -C docs clean $(ALL_OPTIONS)
|
||||
-$(MAKE) -C regtests clean $(ALL_OPTIONS)
|
||||
-$(MAKE) -C docs clean
|
||||
-$(MAKE) -C regtests clean
|
||||
rm -fr .build makefile.setup
|
||||
rm -f config/setup/foo.ali config/setup/foo.o tp_xmlada.gpr
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
############################################################################
|
||||
# Ada Web Server #
|
||||
# #
|
||||
# Copyright (C) 2003-2015, AdaCore #
|
||||
# Copyright (C) 2003-2016, AdaCore #
|
||||
# #
|
||||
# This is free software; you can redistribute it and/or modify it #
|
||||
# under terms of the GNU General Public License as published by the #
|
||||
@@ -19,8 +19,7 @@
|
||||
# Makefile for Sphinx documentation
|
||||
#
|
||||
|
||||
GNATMAKE = gnat make
|
||||
GNATCLEAN = gnat clean
|
||||
-include ../makefile.setup
|
||||
|
||||
ADBFILES = demo.adb user1.adb user2.adb table.adb table_section.adb \
|
||||
table_if.adb matrix.adb table_inline.adb if_inline.adb macro.adb
|
||||
@@ -71,15 +70,16 @@ clean:
|
||||
|
||||
%.adb.res: src/%.adb
|
||||
( cd build/bin; \
|
||||
./`basename $@ .adb.res` > ../samples/`basename $<.res` )
|
||||
./$(SDIR)/static/$* > ../samples/$@ )
|
||||
|
||||
build-sample:
|
||||
mkdir -p build/obj build/bin build/samples
|
||||
$(GNATMAKE) -p -m -Pdocs $(EXEFILES)
|
||||
$(GPRBUILD) -p -m -Pdocs $(EXEFILES) \
|
||||
--subdirs=$(SDIR)/static -XVERSION=$(VERSION)
|
||||
cp src/*.tmplt build/bin
|
||||
|
||||
setup: build-sample $(RESFILES)
|
||||
$(GNATCLEAN) -q -Pdocs
|
||||
$(GPRCLEAN) -q -Pdocs --subdirs=$(SDIR)/static -XVERSION=$(VERSION)
|
||||
|
||||
html: setup
|
||||
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
|
||||
|
||||
@@ -20,9 +20,6 @@
|
||||
|
||||
-include ../makefile.setup
|
||||
|
||||
MODE = $(if $(filter-out true,$(DEBUG)),release,debug)
|
||||
SDIR = $(TARGET)/$(MODE)
|
||||
|
||||
build:
|
||||
$(GPRBUILD) -q -p -XLIBRARY_TYPE=$(DEFAULT_LIBRARY_TYPE) \
|
||||
-XTARGET=$(TARGET) -XPRJ_BUILD=$(PRJ_BUILD) \
|
||||
|
||||
Reference in New Issue
Block a user