cemcom.ansi now builds.
This commit is contained in:
@@ -36,62 +36,3 @@ definerule("llgen",
|
||||
}
|
||||
end
|
||||
)
|
||||
|
||||
--[[
|
||||
D := util/LLgen
|
||||
|
||||
# Rule to build LLgen.
|
||||
|
||||
define build-llgen-impl
|
||||
$(call reset)
|
||||
$(eval cflags += -DNON_CORRECTING -DLIBDIR=\"$(abspath $D/lib)\")
|
||||
$(call cfile, $D/src/main.c)
|
||||
$(call cfile, $D/src/gencode.c)
|
||||
$(call cfile, $D/src/compute.c)
|
||||
$(call cfile, $D/src/check.c)
|
||||
$(call cfile, $D/src/reach.c)
|
||||
$(call cfile, $D/src/global.c)
|
||||
$(call cfile, $D/src/name.c)
|
||||
$(call cfile, $D/src/sets.c)
|
||||
$(call cfile, $D/src/alloc.c)
|
||||
$(call cfile, $D/src/machdep.c)
|
||||
$(call cfile, $D/src/cclass.c)
|
||||
$(call cfile, $D/src/savegram.c)
|
||||
|
||||
# These use pre-LLgen'd version of the files. If LLgen.g gets updated,
|
||||
# they need rebuilding. Use the bootstrap script to do this.
|
||||
|
||||
$(call cfile, $D/src/LLgen.c)
|
||||
$(call cfile, $D/src/Lpars.c)
|
||||
$(call cfile, $D/src/tokens.c)
|
||||
|
||||
$(call cprogram, $(BINDIR)/LLgen)
|
||||
LLGEN := $o
|
||||
endef
|
||||
|
||||
$(eval $(build-llgen-impl))
|
||||
|
||||
# Rule to invoke to *use* LLgen.
|
||||
#
|
||||
# $1: directory to put output files
|
||||
# $2: input files
|
||||
#
|
||||
# Output files are compiled via cfile and queued.
|
||||
|
||||
define llgen-impl
|
||||
$(eval o := $1/Lpars.c $(patsubst %.g, $(strip $1)/%.c, $(notdir $2)))
|
||||
$(eval CLEANABLES += $o $1/Lpars.h)
|
||||
|
||||
$o: $1/Lpars.h
|
||||
$1/Lpars.h: $2 $(LLGEN)
|
||||
@echo LLGEN $1/Lpars.c
|
||||
@mkdir -p $1
|
||||
$(hide) $(RM) $o $1/Lpars.h
|
||||
$(hide) cd $1 && $(LLGEN) $(abspath $2)
|
||||
|
||||
$(foreach f,$o,$(call cfile,$f))
|
||||
|
||||
endef
|
||||
|
||||
llgen = $(eval $(call llgen-impl,$1,$2))
|
||||
--]]
|
||||
|
||||
36
util/data/build.lua
Normal file
36
util/data/build.lua
Normal file
@@ -0,0 +1,36 @@
|
||||
normalrule {
|
||||
name = "generated",
|
||||
ins = {
|
||||
"./new_table",
|
||||
"h/em_table", -- relative to root, which is a bit evil
|
||||
},
|
||||
outleaves = {
|
||||
"em_flag.c",
|
||||
"em_pseu.c",
|
||||
"em_mnem.c",
|
||||
"em_spec.h",
|
||||
"em_pseu.h",
|
||||
"em_mnem.h",
|
||||
},
|
||||
deps = {
|
||||
"h+emheaders"
|
||||
},
|
||||
commands = {
|
||||
"%{ins[1]} %{ins[2]} %{dir} %{dir}"
|
||||
}
|
||||
}
|
||||
|
||||
clibrary {
|
||||
name = "libem",
|
||||
srcs = {
|
||||
"./em_ptyp.c",
|
||||
"+generated", -- so we build the C files
|
||||
},
|
||||
hdrs = {
|
||||
"+generated" -- so we export the H files
|
||||
},
|
||||
deps = {
|
||||
"+generated", -- so we can see the H files
|
||||
"h+emheaders"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user