diff options
author | Lauri Leukkunen <lle@rahina.org> | 2007-06-17 00:20:15 +0300 |
---|---|---|
committer | Lauri Leukkunen <lle@rahina.org> | 2007-06-17 00:20:15 +0300 |
commit | 7ed85d145b84b2cdb4b9a3a498e8253726680ba8 (patch) | |
tree | ae91fb293ff8245a92daacf883fa3e93077c19ea /llbuild | |
parent | 6b372dd8d20aa110470b92f7ae984dd6dfa888f8 (diff) |
Build system updates
Also puts back host-gcc link creation, it seems to be needed.
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
Diffstat (limited to 'llbuild')
-rw-r--r-- | llbuild/Makefile.include | 97 |
1 files changed, 22 insertions, 75 deletions
diff --git a/llbuild/Makefile.include b/llbuild/Makefile.include index 0d4f108..05cd0e3 100644 --- a/llbuild/Makefile.include +++ b/llbuild/Makefile.include @@ -59,94 +59,41 @@ built_in_target := built-in.o all_objects := $(obj-builtin) all_objects += $(foreach t,$(extra_targets),$($(t))) - -define llbuild_link_shbin - @run_sources="$^"; \ - run_target="$@"; \ - run_cmd="$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)"; \ - run_alias="BIN"; \ - $(ll_pretty_run) -endef - -define llbuild_link_shcxxbin - @run_sources="$^"; \ - run_target="$@"; \ - run_cmd="$(CXX) $(CFLAGS) $(LDFLAGS) $(CXXFLAGS) -o $@ $^ $(LIBS)"; \ - run_alias="CXXBIN"; \ - $(ll_pretty_run) -endef - -define llbuild_link_shlib - @run_sources="$^"; \ - run_target="$@"; \ - run_cmd="$(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-soname=$(1) -o $@ $^ $(LIBS)"; \ - run_alias="SHLIB"; \ - $(ll_pretty_run) -endef - -define llbuild_link_archive - @run_sources=""; \ - run_target="$@"; \ - run_cmd="$(CC) -Wl,-r -nostdlib -nodefaultlibs -nostartfiles -o $@ $^"; \ - run_alias="ARCHIVE"; \ - $(ll_pretty_run) -endef - - -ifndef ll_verbose -define ll_pretty_run - run_output="$$($$run_cmd 2>&1)"; \ - if [ $$? -ne 0 ]; then \ - echo "$$run_cmd"; echo "$$run_output"; \ - false; \ - else \ - echo "[$$run_alias] [$$run_target] $$run_sources"; \ - echo "$$run_output" | grep " warning: "; \ - true ; \ - fi -endef +ifdef V +Q = +P = @printf "" # <- space before hash is important!!! else -define ll_pretty_run - echo $$run_cmd; \ - $$run_cmd; -endef +P = @printf "[%s] $@\n" # <- space before hash is important!!! +Q = @ endif -define ll_pretty_build_c - @run_sources="$<"; \ - run_target="$@"; \ - run_cmd="$(CC) $(CFLAGS) -Wp,-MT,$@ -Wp,-MMD,$(dir $@).$(notdir $@).d -o $@ -c $<"; \ - run_alias="CC"; \ - $(ll_pretty_run) -endef +%.so:: + $(P)SHLIB + $(Q)$(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ $(LIBS) -define ll_pretty_build_cc - @run_sources="$<"; \ - run_target="$@"; \ - run_cmd="$(CXX) $(CFLAGS) $(CXXFLAGS) -Wp,-MT,$@ -Wp,-MMD,$(dir $@)/.$(notdir $@).d -o $@ -c $<"; \ - run_alias="CXX"; \ - $(ll_pretty_run) -endef +%.a:: + $(P)ARCHIVE + $(Q)$(CC) -Wl,-r -nostdlib -nodefaultlibs -nostartfiles -o $@ $^ -define ll_pretty_link_builtin - @run_sources="$^"; \ - run_target="$@"; \ - run_cmd="$(CC) -Wl,-r -nostdlib -nodefaultlibs -nostartfiles -o $@ $^"; \ - run_alias="LD"; \ - $(ll_pretty_run) -endef +built-in.o:: %.o + $(P)BUILTIN + $(Q)$(CC) -Wl,-r -nostdlib -nodefaultlibs -nostartfiles -o $@ $^ %.o:: %.S - $(ll_pretty_build_c) + $(P)AS + $(Q)$(CC) $(CFLAGS) -D__ASSEMBLY__ -Wp,-MT,$@ -Wp,-MMD,$(dir $@).$(notdir $@).d -o $@ -c $< %.o:: %.c - $(ll_pretty_build_c) + $(P)CC + $(Q)$(CC) $(CFLAGS) -D__ASSEMBLY__ -Wp,-MT,$@ -Wp,-MMD,$(dir $@).$(notdir $@).d -o $@ -c $< %.o:: %.cc - $(ll_pretty_build_cc) + $(P)CXX + $(Q)$(CXX) $(CFLAGS) $(CXXFLAGS) -Wp,-MT,$@ -Wp,-MMD,$(dir $@)/.$(notdir $@).d -o $@ -c $< %.o:: %.cpp - $(ll_pretty_build_cc) + $(P)CXX + $(Q)$(CXX) $(CFLAGS) $(CXXFLAGS) -Wp,-MT,$@ -Wp,-MMD,$(dir $@)/.$(notdir $@).d -o $@ -c $< %:: %.cc |