2013-05-12 19:45:55 +00:00
|
|
|
# Building tabgen.
|
|
|
|
|
|
|
|
define build-tabgen-impl
|
|
|
|
$(call reset)
|
|
|
|
$(call cfile, util/cmisc/tabgen.c)
|
|
|
|
$(call cprogram, $(BINDIR)/tabgen)
|
|
|
|
$(eval TABGEN := $o)
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(build-tabgen-impl))
|
|
|
|
|
|
|
|
# Using tabgen.
|
|
|
|
#
|
|
|
|
# $1 = input file
|
|
|
|
#
|
|
|
|
# Output file is compiled with cfile and queued.
|
|
|
|
|
|
|
|
define tabgen-impl
|
2013-05-12 22:51:55 +00:00
|
|
|
$(eval g := $(OBJDIR)/$(objdir)/$(strip $1).c)
|
2013-05-12 19:45:55 +00:00
|
|
|
|
|
|
|
$g: $1 $(TABGEN)
|
|
|
|
@echo TABGEN $g
|
|
|
|
@mkdir -p $(dir $g)
|
|
|
|
$(hide) $(TABGEN) -f$(strip $1) > $g || $(RM) $g
|
|
|
|
|
|
|
|
$(eval CLEANABLES += $g)
|
2013-05-12 22:51:55 +00:00
|
|
|
$(call $2,$g)
|
2013-05-12 19:45:55 +00:00
|
|
|
endef
|
|
|
|
|
2013-05-12 22:51:55 +00:00
|
|
|
tabgen = $(eval $(call tabgen-impl,$1,cfile))
|
|
|
|
acktabgen = $(eval $(call tabgen-impl,$1,ackfile))
|
2013-05-12 19:45:55 +00:00
|
|
|
|