source: trunk/build/autotools/common.am @ 1939

Last change on this file since 1939 was 1939, checked in by sam, 8 years ago

build: set default verbosity to 0 and tweak the LolFx build rule so that
it understands V=0 and V=1.

File size: 1.7 KB
Line 
1
2lol_recursive_rule = \
3        @if test -n "$(SUBDIRS)"; then for subdir in $(SUBDIRS); do \
4            ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $(patsubst %-recursive, %, $@)) || exit 1; \
5          done; \
6        fi
7
8bench: bench-recursive
9bench-recursive:
10        $(lol_recursive_rule)
11
12lolcheck: lolcheck-recursive
13lolcheck-recursive:
14        $(lol_recursive_rule)
15
16
17#
18# Flex and Bison files build rule
19#
20
21generated: generated-recursive
22generated-recursive:
23        $(lol_recursive_rule)
24        @if test -n "$(filter %-scanner.l, $(EXTRA_DIST))"; then \
25          echo $(MKDIR_P) generated; \
26          $(MKDIR_P) generated; \
27          rm -f generated/[a-zA-Z]*; \
28          for scanner in $(patsubst %-scanner.l, %, $(filter %-scanner.l, $(EXTRA_DIST))); do \
29            b="`basename $$scanner`"; \
30            echo flex -v -o "generated/$$b-scanner.cpp" "$$scanner-scanner.l"; \
31            flex -v -o "generated/$$b-scanner.cpp" "$$scanner-scanner.l" || exit 1; \
32          done; \
33          for parser in $(patsubst %-parser.y, %, $(filter %-parser.y, $(EXTRA_DIST))); do \
34            b="`basename $$parser`"; \
35            echo bison -o "generated/$$b-parser.cpp" --defines="generated/$$b-parser.h" -d -b "generated/$$b" "$$parser-parser.y"; \
36            bison -o "generated/$$b-parser.cpp" --defines="generated/$$b-parser.h" -d -b "generated/$$b" "$$parser-parser.y" || exit 1; \
37          done; \
38        fi
39
40
41#
42# .lolfx build rule
43#
44
45lolfx_gen = $(lolfx_gen_$(V))
46lolfx_gen_ = $(lolfx_gen_$(AM_DEFAULT_VERBOSITY))
47lolfx_gen_0 = @echo "  LOLFX " $@;
48
49SUFFIXES = .lolfx
50.lolfx.o:
51        $(lolfx_gen)
52        $(AM_V_at)(echo "char const *"; \
53         echo "lolfx_$(notdir $(basename $(filter %.lolfx, $^))) ="; \
54         $(SED) 's/"/\\"/g' $(filter %.lolfx, $^) | $(SED) 's/\([^\r]*\).*/"\1\\n"/'; \
55         echo ";") \
56        | $(CXXCOMPILE) -xc++ -c - -o $@
57
58
59#
60# Additional rules
61#
62
63.PHONY: bench lolcheck generated
64
Note: See TracBrowser for help on using the repository browser.