/* * Copyright (C) 2007-2014 Xagasoft, All rights reserved. * * This file is part of the Xagasoft Build and is released under the * terms of the license contained in the file LICENSE. */ # # 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. if PREFIX == null then { PREFIX = "/usr/local"; } action "default" { build: ["build", targets("plugins")]; } action "man" { build: targets("all"); } action "clean" { clean: "build"; } action "docs" { build: targets("docs"); } action "install" { build: targets("install"); } 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 "/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*"), dirs("/usr/local/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}"); } } } } target PREFIX + "/bin/build" { display "install"; tag "install"; profile "build" { if !exists("build") then { build: "build"; } execute("install -T -s build ${OUTPUT}"); } } for i in [files("share/autoinclude/*.bld"), files("share/include/*.bld")] do { target PREFIX + "/share/build/" + i.replace("share/","") { display "install"; tag "install"; requires i; profile "build" { execute("install -T -D -m0466 ${i} ${OUTPUT}"); } } } target "docs/build-manual.pdf" { display "pdflatex"; tag "docs"; profile "build" { condition always; execute("mkdir -p docs/pdf"); // You have to do this multiple times to get the TOC right. for j in range(1,3) do { notice "Pass ${j}..."; execute("cd docs/pdf; pdflatex ../build-manual.tex > /dev/null"); } execute("mv docs/pdf/build-manual.pdf docs"); execute("rm -Rf docs/pdf"); } } target "docs/html-single/build-manual.html" { display "htlatex"; tag "docs"; profile "build" { condition always; execute("mkdir -p docs/html-single"); execute("cd docs/html-single; htlatex ../build-manual.tex > /dev/null"); } profile "clean" { execute("rm -Rf docs/html-single"); } } target "docs/html-multi" { display "htlatex"; tag "docs"; profile "build" { condition always; execute("mkdir -p docs/html-multi"); execute("cd docs/html-multi; htlatex ../build-manual.tex \"html,3\" > /dev/null"); } profile "clean" { execute("rm -Rf docs/html-multi"); } }