2013-05-12 19:45:55 +00:00
|
|
|
D := util/opt
|
|
|
|
|
|
|
|
define build-opt-mktab-impl
|
|
|
|
|
|
|
|
$(call reset)
|
|
|
|
$(eval cflags += -I$D)
|
|
|
|
|
|
|
|
$(call yacc, $(OBJDIR)/$D, $D/mktab.y)
|
|
|
|
|
|
|
|
$(call flex, $(OBJDIR)/$D, $D/scan.l)
|
|
|
|
$(call dependson, $(OBJDIR)/$D/y.tab.h)
|
|
|
|
|
|
|
|
$(call file, $(LIBEM_DATA))
|
|
|
|
$(call file, -lfl)
|
2013-05-15 21:09:28 +00:00
|
|
|
$(call cprogram, $(OBJDIR)/$D/mktab)
|
2013-05-12 19:45:55 +00:00
|
|
|
|
|
|
|
endef
|
|
|
|
|
|
|
|
define build-opt-impl
|
|
|
|
|
|
|
|
$(call reset)
|
2013-05-15 21:09:28 +00:00
|
|
|
$(eval objdir := $1)
|
|
|
|
|
|
|
|
$(eval cflags += -I$D $2)
|
2013-05-12 19:45:55 +00:00
|
|
|
$(call cfile, $D/main.c)
|
|
|
|
$(call cfile, $D/getline.c)
|
|
|
|
$(call cfile, $D/lookup.c)
|
|
|
|
$(call cfile, $D/var.c)
|
|
|
|
$(call cfile, $D/process.c)
|
|
|
|
$(call cfile, $D/backward.c)
|
|
|
|
$(call cfile, $D/util.c)
|
|
|
|
$(call cfile, $D/alloc.c)
|
|
|
|
$(call cfile, $D/putline.c)
|
|
|
|
$(call cfile, $D/cleanup.c)
|
|
|
|
$(call cfile, $D/peephole.c)
|
|
|
|
$(call cfile, $D/flow.c)
|
|
|
|
$(call cfile, $D/tes.c)
|
|
|
|
$(call cfile, $D/reg.c)
|
|
|
|
|
2013-05-15 21:09:28 +00:00
|
|
|
$(eval g := $(OBJDIR)/$D/$(objdir)/pop_push.c)
|
|
|
|
$(eval CLEANABLES += $g)
|
|
|
|
$g: $D/pop_push.awk h/em_table
|
2013-05-12 19:45:55 +00:00
|
|
|
@echo POP_PUSH $$@
|
|
|
|
@mkdir -p $$(dir $$@)
|
|
|
|
$(hide) awk -f $D/pop_push.awk < h/em_table > $$@
|
2013-05-15 21:09:28 +00:00
|
|
|
$(call cfile, $g)
|
2013-05-12 19:45:55 +00:00
|
|
|
|
2013-05-15 21:09:28 +00:00
|
|
|
$(eval g := $(OBJDIR)/$D/$(objdir)/pattern.c)
|
|
|
|
$(eval CLEANABLES += $g)
|
|
|
|
$g: $(OBJDIR)/$D/mktab $D/patterns $(BINDIR)/cpp.ansi
|
2013-05-12 19:45:55 +00:00
|
|
|
@echo PATTERNS $$@
|
|
|
|
@mkdir -p $$(dir $$@)
|
2013-05-15 21:09:28 +00:00
|
|
|
$(hide) $(BINDIR)/cpp.ansi < $D/patterns | $(OBJDIR)/$D/mktab > $$@
|
|
|
|
$(call cfile, $g)
|
2013-05-12 19:45:55 +00:00
|
|
|
|
|
|
|
$(call file, $(LIBEM_DATA))
|
|
|
|
$(call file, $(LIBASSERT))
|
|
|
|
$(call file, $(LIBPRINT))
|
|
|
|
$(call file, $(LIBALLOC))
|
|
|
|
$(call file, $(LIBSYSTEM))
|
|
|
|
$(call file, $(LIBSTRING))
|
|
|
|
|
|
|
|
$(eval $q: $(INCDIR)/em_spec.h)
|
|
|
|
|
2013-05-15 21:09:28 +00:00
|
|
|
$(call cprogram, $(BINDIR)/$(strip $1))
|
|
|
|
$(call installto, $(PLATDEP)/$(strip $1))
|
2013-05-14 15:11:29 +00:00
|
|
|
$(eval ACK_CORE_TOOLS += $o)
|
2013-05-12 19:45:55 +00:00
|
|
|
|
2013-05-15 21:09:28 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define build-opt-manpage-impl
|
|
|
|
|
2013-05-12 19:45:55 +00:00
|
|
|
$(call reset)
|
|
|
|
$(eval q := $D/em_opt.6)
|
|
|
|
$(call installto, $(INSDIR)/share/man/man6/em_opt.6)
|
|
|
|
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(build-opt-mktab-impl))
|
2013-05-15 21:09:28 +00:00
|
|
|
$(eval $(call build-opt-impl, em_opt,))
|
|
|
|
$(eval $(call build-opt-impl, em_opt2, -DGLOBAL_OPT))
|
|
|
|
$(eval $(build-opt-manpage-impl))
|