diff options
-rw-r--r-- | Makefile | 8 | ||||
-rw-r--r-- | llbuild/Makefile.include | 97 | ||||
-rw-r--r-- | mapping/Makefile | 1 | ||||
-rw-r--r-- | preload/Makefile | 13 | ||||
-rw-r--r-- | utils/Makefile | 3 |
5 files changed, 33 insertions, 89 deletions
@@ -48,8 +48,7 @@ install: $(targets) install -d -m 755 $(prefix)/share/scratchbox2/redir_scripts/preload/default install -d -m 755 $(prefix)/share/scratchbox2/redir_scripts/preload/emulate install -d -m 755 $(prefix)/share/man/man1 - install -c -m 755 preload/libsb2.so.$(PACKAGE_VERSION) $(prefix)/lib/libsb2/libsb2.so.$(PACKAGE_VERSION) - cd $(prefix)/lib/libsb2/; ln -s libsb2.so.$(PACKAGE_VERSION) libsb2.so.1 + install -c -m 755 preload/libsb2.so $(prefix)/lib/libsb2/libsb2.so.$(PACKAGE_VERSION) install -c -m 755 utils/sb2 $(prefix)/bin/sb2 install -c -m 755 utils/sb2-init $(prefix)/bin/sb2-init install -c -m 755 utils/sb2-build-libtool $(prefix)/bin/sb2-build-libtool @@ -59,13 +58,12 @@ install: $(targets) install -c -m 644 redir_scripts/preload/emulate/*.lua $(prefix)/share/scratchbox2/redir_scripts/preload/emulate/ install -c -m 644 etc/sb2.config.sample $(prefix)/share/scratchbox2/sb2.config.sample install -c -m 644 docs/sb2.1 $(prefix)/share/man/man1/sb2.1 - # unneeded -# @for f in $(gcc_bins_expanded); do \ + @for f in $(gcc_bins_expanded); do \ ln -sf sb_gcc_wrapper $$f; \ done rm -f $(prefix)/share/scratchbox2/host_usr ln -sf /usr $(prefix)/share/scratchbox2/host_usr - /sbin/ldconfig -n $(prefix)/lib + /sbin/ldconfig -n $(prefix)/lib/libsb2 CLEAN_FILES = $(targets) config.status config.log 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 diff --git a/mapping/Makefile b/mapping/Makefile index 3275aa4..693f03b 100644 --- a/mapping/Makefile +++ b/mapping/Makefile @@ -3,7 +3,6 @@ source_list := $(shell find $(LLPWD)/lua-5.1.1/src -name "*.c" -not -name "lua.c objs := $(source_list:.c=.o) $(LLPWD)/mapping.o mapping/libmapping.a: $(objs) - $(llbuild_link_archive) mapping/libmapping.a: override CFLAGS := -O2 -g -fPIC -Wall -W -I$(LLPWD)/lua-5.1.1/src $(CFLAGS) mapping/libmapping.a: override LDFLAGS := $(LDFLAGS) diff --git a/preload/Makefile b/preload/Makefile index e0ee8f8..015c5d0 100644 --- a/preload/Makefile +++ b/preload/Makefile @@ -1,14 +1,13 @@ objs := libsb2.o libsb_env.o sb_exec.o -preload/libsb2.so.$(PACKAGE_VERSION): $(call llep,$(objs)) - $(call llbuild_link_shlib,$(LIBSB2_SONAME)) +preload/libsb2.so: $(call llep,$(objs)) -preload/libsb2.so.$(PACKAGE_VERSION): mapping/libmapping.a +preload/libsb2.so: mapping/libmapping.a -preload/libsb2.so.$(PACKAGE_VERSION): CFLAGS := $(CFLAGS) -fPIC -Wall -W -preload/libsb2.so.$(PACKAGE_VERSION): LDFLAGS := $(LDFLAGS) -preload/libsb2.so.$(PACKAGE_VERSION): LIBS := -ldl -lm -lpthread -lrt +preload/libsb2.so: CFLAGS := $(CFLAGS) -fPIC -Wall -W +preload/libsb2.so: LDFLAGS := $(LDFLAGS) -Wl,-soname=libsb2.so.1 +preload/libsb2.so: LIBS := -ldl -lm -lpthread -lrt -targets += preload/libsb2.so.$(PACKAGE_VERSION) +targets += preload/libsb2.so diff --git a/utils/Makefile b/utils/Makefile index f0f1f5a..368a732 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -1,5 +1,6 @@ utils/sb_gcc_wrapper: utils/sb_gcc_wrapper.o utils/sb_config.o - $(llbuild_link_shcxxbin) + $(P)CXX + $(Q)$(CXX) $(CFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) targets += utils/sb_gcc_wrapper |