# # default.bld for build mark 3. This guy does it all, so watch out! # :) # CXXFLAGS += "-fPIC -rdynamic"; LDFLAGS += "-fPIC -rdynamic -Wl,-export-dynamic"; CXXFLAGS += "-ggdb -W -Wall"; CC = CXX; // We actually want to use c++ to compile our c files. action "default" { // build: "build"; build: ["build", targets("plugins")]; } action "man" { build: targets("all"); } action "pkg" { build: targets("pkg"); } action "clean" { clean: "build"; } action "devinstall" { if "$(id -u)" != "0" then { error "You can only install as the root user, su then run this."; } install: targets("devinstall"); } action "viminstall" { if "$(id -u)" != "0" then { error "You can only install as the root user, su then run this."; } install: targets("viminstall"); } target "build" { input [files("src/*.y"), files("src/*.l"), files("src/*.cpp")]; rule "exe"; LDFLAGS += "-Llibbu++ -lbu++ -ldl"; CXXFLAGS += "-Ilibbu++"; CFLAGS = CXXFLAGS; tag "tools"; } for IN in files("src/plugins/*.cpp") do { target IN.replace("src/","").replace(".cpp", ".so") { input IN; rule "so"; LDFLAGS += "-Llibbu++ -lbu++ -ldl"; CXXFLAGS += "-Ilibbu++ -Isrc"; tag "plugins"; } } target "minibu" { profile "build" { condition always; execute("./build.sh setup"); } } PKG_BASE = "build-$(cat version)-r$(svnversion "-n").tar"; target PKG_BASE { input [ "Doxyfile", "default.bld", "docs/build.1", "docs/build.7", "support/vim/syntax/build.vim", "support/vim/ftdetect/build.vim", "support/vim/ftplugin/build.vim", files("src/*.y"), files("src/*.l"), files("src/*.c"), files("src/*.cpp"), files("src/*.h"), files("share/autoinclude/*"), files("share/include/*"), "minibu", files("minibu/bu/*"), files("minibu/src/*") ]; rule "tarball"; tag "pkg"; } target PKG_BASE + ".gz" { input PKG_BASE; tag "pkg"; display "gzip"; profile "build" { execute("gzip -9 < ${INPUT} > ${OUTPUT}"); } } target PKG_BASE + ".bz2" { input PKG_BASE; tag "pkg"; display "bzip2"; profile "build" { execute("bzip2 -9 < ${INPUT} > ${OUTPUT}"); } } target PKG_BASE + ".xz" { input PKG_BASE; tag "pkg"; display "xz"; profile "build" { execute("xz -9vv < ${INPUT} > ${OUTPUT}"); } } rule "tarball" { input matches("*.cpp", "*.h", "*.c", "*.y", "*.l", "*.conf", "Doxyfile", "*.1", "*.7", "*.vim"); profile "build" { OUTDIR = OUTPUT.replace(".tar.bz2",""); execute("tar -f ./${OUTPUT} --transform=\"s@^@${OUTDIR}/@\" -c ${INPUT}"); } } target "/usr/share/build" { input "$(echo -n $PWD)/share"; tag "devinstall"; display "symlink"; profile "install" { execute("ln -fsv \"${INPUT}\" \"${OUTPUT}\""); } } target "/usr/lib/build" { input "$(echo -n $PWD)/plugins"; tag "devinstall"; display "symlink"; profile "install" { execute("ln -fsv \"${INPUT}\" \"${OUTPUT}\""); } } for vimdir in dirs("/usr/share/vim/vim*") do { for ftype in ["ftplugin/build.vim", "ftdetect/build.vim", "syntax/build.vim"] do { target vimdir + "/" + ftype { input "support/vim/" + ftype; tag "viminstall"; display "install"; profile "install" { DIR = OUTPUT.dirName(); execute("mkdir -p ${DIR}"); execute("cp -f ${INPUT} ${OUTPUT}"); } } } }