0
|
1 |
#
|
|
2 |
# Yacc extra-compiler for handling files specified in the YACCSOURCES variable
|
|
3 |
#
|
|
4 |
|
|
5 |
{
|
|
6 |
yacc_decl.name = Yacc header
|
|
7 |
yacc_decl.input = YACCSOURCES
|
|
8 |
yacc_decl.variable_out = GENERATED_FILES
|
|
9 |
|
|
10 |
|
|
11 |
isEmpty(QMAKE_YACCFLAGS_MANGLE) {
|
|
12 |
QMAKE_YACCFLAGS_MANGLE = -p ${QMAKE_FILE_BASE}
|
|
13 |
QMAKE_YACC_HEADER = y.tab.h
|
|
14 |
QMAKE_YACC_SOURCE = y.tab.c
|
|
15 |
} else {
|
|
16 |
QMAKE_YACCFLAGS_MANGLE ~= s/\\$base/${QMAKE_FILE_BASE}/g #backwards compat
|
|
17 |
QMAKE_YACC_HEADER ~= s/\\$base/${QMAKE_FILE_BASE}/g
|
|
18 |
QMAKE_YACC_SOURCE ~= s/\\$base/${QMAKE_FILE_BASE}/g
|
|
19 |
}
|
|
20 |
QMAKE_YACCDECLFLAGS = $$QMAKE_YACCFLAGS
|
|
21 |
!yacc_no_name_mangle:QMAKE_YACCDECLFLAGS += $$QMAKE_YACCFLAGS_MANGLE
|
|
22 |
|
|
23 |
yacc_decl.commands = \
|
|
24 |
$$QMAKE_YACC $$QMAKE_YACCDECLFLAGS ${QMAKE_FILE_IN}$$escape_expand(\n\t) \
|
|
25 |
$$QMAKE_DEL_FILE $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}_yacc$${first(QMAKE_EXT_H)} $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}_yacc$${first(QMAKE_EXT_CPP)}$$escape_expand(\n\t) \
|
|
26 |
$$QMAKE_MOVE $${QMAKE_YACC_HEADER} $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}_yacc$${first(QMAKE_EXT_H)}$$escape_expand(\n\t) \
|
|
27 |
$$QMAKE_MOVE $${QMAKE_YACC_SOURCE} $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}_yacc$${first(QMAKE_EXT_CPP)}$$escape_expand(\n\t)
|
|
28 |
yacc_decl.output = $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}_yacc$${first(QMAKE_EXT_H)}
|
|
29 |
|
|
30 |
silent:yacc_decl.commands = @echo Yacc ${QMAKE_FILE_IN} && $$yacc_decl.commands
|
|
31 |
QMAKE_EXTRA_COMPILERS += yacc_decl
|
|
32 |
}
|
|
33 |
|
|
34 |
{
|
|
35 |
yacc_impl.name = source for ${QMAKE_FILE_IN}
|
|
36 |
yacc_impl.input = YACCSOURCES
|
|
37 |
yacc_impl.variable_out = GENERATED_SOURCES
|
|
38 |
yacc_impl.commands = $$escape_expand(\n) # We don't want any commands where, but if command is empty no rules are created
|
|
39 |
yacc_impl.depends = $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}_yacc$${first(QMAKE_EXT_H)} # Make sure we depend on the step above
|
|
40 |
yacc_impl.output = $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}_yacc$${first(QMAKE_EXT_CPP)} # Faked output from this step, output really created in step above
|
|
41 |
QMAKE_EXTRA_COMPILERS += yacc_impl
|
|
42 |
}
|