summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLauri Leukkunen <lle@rahina.org>2006-08-15 19:40:59 +0300
committerLauri Leukkunen <lleukkun@leka.rahina.org>2006-08-15 19:40:59 +0300
commitbba0cea1f070d115bfac597fcc861455f949f96f (patch)
tree1da368cb9604472255889fcafbced82da474a236
parentf9119361be42c041452c6c7e8dae61419cf884eb (diff)
* change some pretty print naming conventions to use ll_ prefix
* cleanup top level Makefile by moving some stuff to Makefile.include
-rw-r--r--Makefile11
-rw-r--r--Makefile.include39
-rw-r--r--preload/Makefile2
-rw-r--r--utils/Makefile2
4 files changed, 31 insertions, 23 deletions
diff --git a/Makefile b/Makefile
index bb46038..31d3e90 100644
--- a/Makefile
+++ b/Makefile
@@ -21,7 +21,7 @@ configure: configure.ac
./configure
build: configure
- @$(MAKE) -f Makefile.build ll_mainlevel
+ $(ll_toplevel_build)
@echo Build completed successfully!
install: build
@@ -38,16 +38,9 @@ install: build
CLEAN_FILES = $(targets)
clean:
- rm -rf $(CLEAN_FILES)
- find . -name "*.[oasd]" -o -name ".*.d" -o -name "*.*~" -o -name "*~" -o -name "*.lock"| xargs rm -rf
+ $(ll_clean)
-include .config
-
-# this chicanery prevents Makefile.include from being included twice
-ifndef _TOP_LEVEL_MAKEFILE
-_TOP_LEVEL_MAKEFILE=1
-export _TOP_LEVEL_MAKEFILE
include Makefile.include
-endif
diff --git a/Makefile.include b/Makefile.include
index baeba85..0c39ae0 100644
--- a/Makefile.include
+++ b/Makefile.include
@@ -21,6 +21,10 @@
# SOFTWARE.
+# Make sure this file is only included once per make invocation
+ifndef _LL_BUILD_MAKEFILE_INCLUDE
+_LL_BUILD_MAKEFILE_INCLUDE=1
+
built_in_target := built-in.o
builtin_files := $(patsubst %,%/built-in.o,$(subdirs))
@@ -43,12 +47,12 @@ ll_subdir: $(subdir_deps)
@$(MAKE) --no-print-directory -f $(TOPDIR)/Makefile.build $(built_in_target) $(extra_targets)
$(built_in_target): $(obj-default)
- $(pretty_link_builtin)
+ $(ll_pretty_link_builtin)
OPT_CURDIR = $(patsubst /%,%,$(strip $(subst $(TOPDIR), , $(CURDIR))))
-define pretty_run
+define ll_pretty_run
run_output=$$($$run_cmd 2>&1); \
if [ $$? -ne 0 ]; then \
echo $$run_cmd; echo $(OPT_CURDIR)/$$run_output; \
@@ -60,35 +64,35 @@ define pretty_run
fi
endef
-define pretty_build_c
+define ll_pretty_build_c
@run_cmd="$(CC) $(CFLAGS) -Wp,-MD,$(dir $(@))/.$(notdir $(@)).d -o $@ -c $<"; \
run_alias="CC"; \
- $(pretty_run)
+ $(ll_pretty_run)
endef
-define pretty_link_builtin
+define ll_pretty_link_builtin
@run_cmd="$(LD) -r -nostartfiles $(LDFLAGS) -o $@ $^"; \
run_alias="LD"; \
- $(pretty_run)
+ $(ll_pretty_run)
endef
-define pretty_link_shared_library
+define ll_pretty_link_shared_library
@run_cmd="$(CC) -shared -o $@ $^ $(LIBS)"; \
run_alias="LD SHARED LIB"; \
- $(pretty_run)
+ $(ll_pretty_run)
endef
-define pretty_link_shared_binary
+define ll_pretty_link_shared_binary
@run_cmd="$(CC) -o $@ $^ $(LIBS)"; \
run_alias="LD SHARED BIN";\
- $(pretty_run)
+ $(ll_pretty_run)
endef
%.o: %.S
- $(pretty_build_c)
+ $(ll_pretty_build_c)
%.o: %.c
- $(pretty_build_c)
+ $(ll_pretty_build_c)
dep_files = $(wildcard .*.d)
@@ -99,3 +103,14 @@ endif
.PHONY: build $(subdirs)
+define ll_clean
+ rm -rf $(CLEAN_FILES)
+ find . -name "*.[oasd]" -o -name ".*.d" -o -name "*.*~" -o -name "*~" -o -name "*.lock"| xargs rm -rf
+endef
+
+define ll_toplevel_build
+ +$(MAKE) --no-print-directory -f Makefile.build ll_mainlevel
+endef
+
+endif
+
diff --git a/preload/Makefile b/preload/Makefile
index 571d7a6..578ca20 100644
--- a/preload/Makefile
+++ b/preload/Makefile
@@ -8,5 +8,5 @@ obj-default = libsb2.o libsb_env.o sb_alien.o
extra_targets = libsb2.so
libsb2.so: built-in.o ../lua/built-in.o
- $(pretty_link_shared_library)
+ $(ll_pretty_link_shared_library)
diff --git a/utils/Makefile b/utils/Makefile
index 5aacab2..7da57de 100644
--- a/utils/Makefile
+++ b/utils/Makefile
@@ -2,5 +2,5 @@ obj-default = sb2init.o
extra_targets = sb2init
sb2init: sb2init.o
- $(pretty_link_shared_binary)
+ $(ll_pretty_link_shared_binary)