2011-04-27 10:05:43 +00:00
#
# Yacc extra-compiler for handling files specified in the YACCSOURCES variable
#
{
yacc_decl.name = Yacc header
yacc_decl.input = YACCSOURCES
yacc_decl.variable_out = GENERATED_FILES
isEmpty(QMAKE_YACCFLAGS_MANGLE) {
2015-07-18 02:17:05 +00:00
QMAKE_YACCFLAGS_MANGLE = -p ${QMAKE_FILE_BASE} -b ${QMAKE_FILE_BASE}
QMAKE_YACC_HEADER = ${QMAKE_FILE_BASE}.tab.h
QMAKE_YACC_SOURCE = ${QMAKE_FILE_BASE}.tab.c
2011-04-27 10:05:43 +00:00
} else {
QMAKE_YACCFLAGS_MANGLE ~= s/\\$base/${QMAKE_FILE_BASE}/g #backwards compat
QMAKE_YACC_HEADER ~= s/\\$base/${QMAKE_FILE_BASE}/g
QMAKE_YACC_SOURCE ~= s/\\$base/${QMAKE_FILE_BASE}/g
}
QMAKE_YACCDECLFLAGS = $$QMAKE_YACCFLAGS
!yacc_no_name_mangle:QMAKE_YACCDECLFLAGS += $$QMAKE_YACCFLAGS_MANGLE
yacc_decl.commands = \
2015-09-24 06:10:29 +00:00
-$(DEL_FILE) $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}$${QMAKE_MOD_YACC}$${first(QMAKE_EXT_H)} $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}$${QMAKE_MOD_YACC}$${first(QMAKE_EXT_CPP)}$$escape_expand(\\n\\t) \
2011-04-27 10:05:43 +00:00
$$QMAKE_YACC $$QMAKE_YACCDECLFLAGS ${QMAKE_FILE_IN}$$escape_expand(\\n\\t) \
2015-09-24 06:10:29 +00:00
$(MOVE) $${QMAKE_YACC_HEADER} $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}$${QMAKE_MOD_YACC}$${first(QMAKE_EXT_H)}$$escape_expand(\\n\\t) \
$(MOVE) $${QMAKE_YACC_SOURCE} $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}$${QMAKE_MOD_YACC}$${first(QMAKE_EXT_CPP)}$$escape_expand(\\n\\t)
yacc_decl.output = $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}$${QMAKE_MOD_YACC}$${first(QMAKE_EXT_H)}
2011-04-27 10:05:43 +00:00
silent:yacc_decl.commands = @echo Yacc ${QMAKE_FILE_IN} && $$yacc_decl.commands
QMAKE_EXTRA_COMPILERS += yacc_decl
}
{
yacc_impl.name = source for ${QMAKE_FILE_IN}
yacc_impl.input = YACCSOURCES
yacc_impl.variable_out = GENERATED_SOURCES
yacc_impl.commands = $$escape_expand(\\n) # We don't want any commands where, but if command is empty no rules are created
2016-06-23 09:50:39 +00:00
yacc_impl.depends += $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}$${QMAKE_MOD_YACC}$${first(QMAKE_EXT_H)} # Make sure we depend on the step above
2015-09-24 06:10:29 +00:00
yacc_impl.output = $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}$${QMAKE_MOD_YACC}$${first(QMAKE_EXT_CPP)} # Faked output from this step, output really created in step above
2011-04-27 10:05:43 +00:00
QMAKE_EXTRA_COMPILERS += yacc_impl
}