From 49d7681be69dfb0f3f31e0091592f33e27a40c23 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 2 Aug 2009 17:24:00 +0200 Subject: Initialize the build system --- build/bootstrap.make | 49 +++++++++++++++++++++++++++++++++++ cli/makefile | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++ makefile | 44 +++++++++++++++++++++++++++++++ 3 files changed, 166 insertions(+) create mode 100644 build/bootstrap.make create mode 100644 cli/makefile create mode 100644 makefile diff --git a/build/bootstrap.make b/build/bootstrap.make new file mode 100644 index 0000000..1df57a6 --- /dev/null +++ b/build/bootstrap.make @@ -0,0 +1,49 @@ +# file : build/bootstrap.make +# author : Boris Kolpackov +# copyright : Copyright (c) 2009 Code Synthesis Tools CC +# license : TBD + +project_name := CLI + +include build-0.3/bootstrap.make + + +# Aliases +# +ifdef %interactive% + +.PHONY: test $(out_base)/.test \ + install $(out_base)/.install \ + dist $(out_base)/.dist \ + clean $(out_base)/.clean + +test: $(out_base)/.test +install: $(out_base)/.install +dist: $(out_base)/.dist +clean: $(out_base)/.clean + +ifneq ($(filter $(.DEFAULT_GOAL),test install dist clean),) +.DEFAULT_GOAL := +endif + +endif + + +# Make sure the distribution prefix is set if the goal is dist. +# +ifneq ($(filter $(MAKECMDGOALS),dist),) +ifeq ($(dist_prefix),) +$(error dist_prefix is not set) +endif +endif + + +# Don't include dependency info for certain targets. +# +define include-dep +$(call -include,$1) +endef + +ifneq ($(filter $(MAKECMDGOALS),clean disfigure),) +include-dep = +endif diff --git a/cli/makefile b/cli/makefile new file mode 100644 index 0000000..276408d --- /dev/null +++ b/cli/makefile @@ -0,0 +1,73 @@ +# file : cli/makefile +# author : Boris Kolpackov +# copyright : Copyright (c) 2009 Code Synthesis Tools CC +# license : TBD + +include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make + +cxx_tun := cli.cxx + +# +# +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) +cxx_od := $(cxx_obj:.o=.o.d) + +cli := $(out_base)/cli +dist := $(out_base)/.dist +clean := $(out_base)/.clean +install := $(out_base)/.install + +# Build. +# +$(cli): $(cxx_obj) + +$(cxx_obj) $(cxx_od): cpp_options := -I$(src_base) + +$(call include-dep,$(cxx_od)) + +# Alias for default target. +# +.PHONY: $(out_base)/ +$(out_base)/: $(cli) + +# Dist. +# +.PHONY: $(dist) + +# @@ TODO + +# Install. +# +.PHONY: $(install) + +$(install): $(cli) + $(call install-exec,$<,$(install_bin_dir)/cli) + +# Clean. +# +.PHONY: $(clean) + +$(clean): \ + $(cli).o.clean \ + $(addsuffix .cxx.clean,$(cxx_obj)) \ + $(addsuffix .cxx.clean,$(cxx_od)) + + +# Generated .gitignore. +# +ifeq ($(out_base),$(src_base)) +$(cli): | $(out_base)/.gitignore + +$(out_base)/.gitignore: files := cli +$(clean): $(out_base)/.gitignore.clean + +$(call include,$(bld_root)/git/gitignore.make) +endif + + +# how to +# +$(call include,$(bld_root)/cxx/o-e.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/install.make) diff --git a/makefile b/makefile new file mode 100644 index 0000000..6bed677 --- /dev/null +++ b/makefile @@ -0,0 +1,44 @@ +# file : makefile +# author : Boris Kolpackov +# copyright : Copyright (c) 2009 Code Synthesis Tools CC +# license : TBD + +include $(dir $(lastword $(MAKEFILE_LIST)))build/bootstrap.make + +default := $(out_base)/ +test := $(out_base)/.test +install := $(out_base)/.install +dist := $(out_base)/.dist +clean := $(out_base)/.clean + + +.PHONY: $(default) $(test) $(install) $(dist) $(clean) + +# Build. +# +$(default): $(out_base)/cli/ + +# Test. +# +$(test): #$(out_base)/tests/.test + +# Install. +# +$(install): $(out_base)/cli/.install \ + $(out_base)/documentation/.install + $(call install-data,$(src_base)/LICENSE,$(install_doc_dir)/cli/LICENSE) + $(call install-data,$(src_base)/NEWS,$(install_doc_dir)/cli/NEWS) + $(call install-data,$(src_base)/README,$(install_doc_dir)/cli/README) + +# Dist. +# + +# @@ TODO + +# Clean. +# +$(clean): $(out_base)/cli/.clean + +$(call include,$(bld_root)/install.make) + +$(call import,$(src_base)/cli/makefile) -- cgit v1.1