ack/util/ack/build.lua
David Given 09554cb324 installable works, although it's a bit kludgy. Change the : separator to +
because : is special in make and non of the others I could think of would work.
2016-06-14 07:34:14 +02:00

99 lines
1.8 KiB
Lua

cprogram {
name = "mktables",
srcs = { "./mktables.c" },
}
normalrule {
name = "tables",
outleaves = { "dmach.c", "intable.c" },
ins = {
"+mktables",
"lib/descr/fe",
},
commands = {
"(cd %{dir} && %{abspath(ins[1])} lib)"
}
}
cprogram {
name = "ack",
srcs = {
"./*.c",
"./*.h",
"+tables",
},
deps = {
"h+emheaders",
"h+local",
}
}
installable {
name = "ack-pkg",
map = {
["$(INSDIR)/bin/ack"] = "+ack",
["$(INSDIR)/share/man/man1/ack.1"] = "./ack.1.X",
["$(PLATIND)/descr/fe"] = "lib/descr/fe",
}
}
--[[
D := util/ack
define util-ack-makeheaders-rule
$(eval g := $(OBJDIR)/$D/dmach.c $(OBJDIR)/$D/intable.c)
$(wordlist 2, $(words $g), $g): $(firstword $g)
$(firstword $g): $(util-ack-mktables)
@echo MKTABLES
@mkdir -p $(OBJDIR)/$D
$(hide) cd $(OBJDIR)/$D && $(util-ack-mktables) $(INSDIR)/share
$(eval CLEANABLES += $g)
endef
define build-ack-impl
$(call reset)
$(call cfile, $D/mktables.c)
$(call cprogram, $(OBJDIR)/$D/mktables)
$(eval util-ack-mktables := $o)
$(call reset)
$(eval cflags += -I$D)
$(call cfile, $D/list.c)
$(call cfile, $D/data.c)
$(call cfile, $D/main.c)
$(call cfile, $D/scan.c)
$(call cfile, $D/svars.c)
$(call cfile, $D/trans.c)
$(call cfile, $D/util.c)
$(call cfile, $D/rmach.c)
$(call dependson, $(INCDIR)/em_path.h)
$(call cfile, $D/run.c)
$(call cfile, $D/grows.c)
$(call cfile, $D/files.c)
$(call dependson, $(INCDIR)/em_path.h)
$(eval $(util-ack-makeheaders-rule))
$(call cfile, $(OBJDIR)/$D/dmach.c)
$(call cfile, $(OBJDIR)/$D/intable.c)
$(call cprogram, $(BINDIR)/ack)
$(call installto, $(INSDIR)/bin/ack)
$(eval ACK := $o)
$(call reset)
$(eval q := lib/descr/fe)
$(call installto, $(PLATIND)/descr/fe)
$(eval $(ACK): $o)
$(call reset)
$(eval q := $D/ack.1.X)
$(call installto, $(INSDIR)/share/man/man1/ack.1)
endef
$(eval $(build-ack-impl))
--]]