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

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

lolfx: names such as "x" or "bgra" are field selectors, but we must also
accept them as variable names.

File size: 1.6 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
45SUFFIXES = .lolfx
46.lolfx.o:
47        (echo "char const *"; \
48         echo "lolfx_$(notdir $(basename $(filter %.lolfx, $^))) ="; \
49         $(SED) 's/"/\\"/g' $(filter %.lolfx, $^) | $(SED) 's/\([^\r]*\).*/"\1\\n"/'; \
50         echo ";") \
51        | $(CXXCOMPILE) -xc++ -c - -o $@
52
53
54#
55# Additional rules
56#
57
58.PHONY: bench lolcheck generated
59
Note: See TracBrowser for help on using the repository browser.