Top, topgen, aelflod. Moved the libraries back into the platform-specific

directories --- wrangling descr files was too hard. C programs can be built
for cpm, pc86, linux386, linux68k!

--HG--
branch : dtrg-buildsystem
rename : util/ack/build.mk => util/led/build.mk
rename : util/LLgen/build.mk => util/topgen/build.mk
This commit is contained in:
David Given
2013-05-13 23:26:15 +01:00
parent 442306d557
commit 07453d184a
27 changed files with 398 additions and 55 deletions

View File

@@ -46,6 +46,7 @@ $o: $1/Lpars.h
$1/Lpars.h: $2 $(LLGEN)
@echo LLGEN $1/Lpars.c
@mkdir -p $(dir $o)
$(hide) $(RM) $o $1/Lpars.h
$(hide) cd $(dir $o) && $(LLGEN) $(abspath $2)
$(foreach f,$o,$(call cfile,$f))

View File

@@ -19,4 +19,5 @@ $(call build-simple-tool,ashow)
$(call build-simple-tool,asize)
$(call build-simple-tool,aslod)
$(call build-simple-tool,astrip)
$(call build-simple-tool,aelflod)

View File

@@ -22,6 +22,9 @@ $(call cfile, $(OBJDIR)/$D/em_flag.c)
$(call cfile, $(OBJDIR)/$D/em_pseu.c)
$(call cfile, $(OBJDIR)/$D/em_mnem.c)
$(call cfile, $D/em_ptyp.c)
$(eval $q: $g)
$(call clibrary, $(LIBDIR)/libem_data.a)
$(eval LIBEM_DATA := $q)

34
util/led/build.mk Normal file
View File

@@ -0,0 +1,34 @@
D := util/led
define build-led-impl
$(call reset)
$(call cfile, $D/archive.c)
$(call cfile, $D/error.c)
$(call cfile, $D/extract.c)
$(call cfile, $D/finish.c)
$(call cfile, $D/main.c)
$(call cfile, $D/memory.c)
$(call cfile, $D/output.c)
$(call cfile, $D/read.c)
$(call cfile, $D/relocate.c)
$(call cfile, $D/save.c)
$(call cfile, $D/scan.c)
$(call cfile, $D/sym.c)
$(call cfile, $D/write.c)
$(call file, $(LIBSTRING))
$(call file, $(LIBOBJECT))
$(call cprogram, $(BINDIR)/em_led)
$(call installto, $(PLATDEP)/em_led)
$(call reset)
$(eval q := $D/ack.out.5)
$(call installto, $(INSDIR)/share/man/man5/ack.out.5)
$(call reset)
$(eval q := $D/led.6)
$(call installto, $(INSDIR)/share/man/man6/led.6)
endef
$(eval $(build-led-impl))

View File

@@ -32,6 +32,8 @@ $(OBJDIR)/$D/enterkeyw.c: $D/cvtkeywords $D/keywords
$(hide) cd $$(dir $$@) && sh $(abspath $D/cvtkeywords) $(abspath $D/keywords)
$(call cfile, $(OBJDIR)/$D/enterkeyw.c)
$(eval $q: $(INCDIR)/em_spec.h)
$(call file, $(LIBEM_DATA))
$(call cprogram, $(BINDIR)/ncgg)
$(eval NCGG := $o)

50
util/topgen/build.mk Normal file
View File

@@ -0,0 +1,50 @@
D := util/topgen
# Rule to build topgen.
define build-topgen-impl
$(call reset)
$(eval cflags += -I$(OBJDIR)/$D -I$D)
$(call cfile, $D/LLlex.c)
$(call cfile, $D/hash.c)
$(call cfile, $D/main.c)
$(call cfile, $D/pattern.c)
$(call cfile, $D/symtab.c)
$(eval $q: $(OBJDIR)/$D/Lpars.h)
$(call llgen, $(OBJDIR)/$D, $D/topgen.g)
$(call file, $(LIBASSERT))
$(call file, $(LIBPRINT))
$(call file, $(LIBALLOC))
$(call file, $(LIBSYSTEM))
$(call file, $(LIBSTRING))
$(call cprogram, $(BINDIR)/topgen)
TOPGEN := $o
endef
$(eval $(build-topgen-impl))
# Rule to invoke to *use* LLgen.
#
# $1: directory to put output files
# $2: input files
#
# Output files are *not* compiled (gen.c is expected to be included by
# something).
define topgen-impl
$(eval CLEANABLES += $1/gen.h $1/gen.c)
$1/gen.h: $1/gen.c
$1/gen.c: $2 $(TOPGEN)
@echo TOPGEN $$@
@mkdir -p $$(dir $$@)
$(hide) $(RM) $1/gen.h $1/gen.c
$(hide) cd $$(dir $$@) && $(abspath $(TOPGEN)) $(abspath $2)
endef
topgen = $(eval $(call topgen-impl,$1,$2))