Also make the "INFO" messages easier to identify.
Signed-off-by: Paul Moore <[email protected]>
---
Makefile | 24 ++++++++++++------------
macros.mk | 57 ++++++++++-----------------------------------------------
2 files changed, 22 insertions(+), 59 deletions(-)
diff --git a/Makefile b/Makefile
index 94de37b..5f7aa9b 100644
--- a/Makefile
+++ b/Makefile
@@ -46,13 +46,13 @@ SUBDIRS_INSTALL = src include doc
all: $(SUBDIRS_BUILD)
$(CONFIGS): version_info
- @$(ECHO) "INFO: automatically generating configuration ..."
+ @$(ECHO) ">> INFO: automatically generating configuration ..."
@./configure
tarball: clean
@ver=$(VERSION_RELEASE); \
tarball=libseccomp-$$ver.tar.gz; \
- $(ECHO) "INFO: creating the tarball ../$$tarball"; \
+ $(ECHO) ">> INFO: creating the tarball ../$$tarball"; \
tmp_dir=$$(mktemp -d /tmp/libseccomp.XXXXX); \
rel_dir=$$tmp_dir/libseccomp-$$ver; \
$(MKDIR) $$rel_dir; \
@@ -63,7 +63,7 @@ tarball: clean
$(RM) -rf $$tmp_dir;
$(VERSION_HDR): version_info.mk
- @$(ECHO) "INFO: creating the version header file"
+ @$(ECHO) ">> INFO: creating the version header file"
@hdr="$(VERSION_HDR)"; \
$(ECHO) "/* automatically generated - do not edit */" > $$hdr; \
$(ECHO) "#ifndef _VERSION_H" >> $$hdr; \
@@ -72,40 +72,40 @@ $(VERSION_HDR): version_info.mk
$(ECHO) "#endif" >> $$hdr;
src: $(VERSION_HDR) $(CONFIGS)
- @$(ECHO) "INFO: building in directory $@/ ..."
+ @$(ECHO) ">> INFO: building in directory $@/ ..."
@$(MAKE) -C $@
tests: src
- @$(ECHO) "INFO: building in directory $@/ ..."
+ @$(ECHO) ">> INFO: building in directory $@/ ..."
@$(MAKE) -C $@
tools: src
- @$(ECHO) "INFO: building in directory $@/ ..."
+ @$(ECHO) ">> INFO: building in directory $@/ ..."
@$(MAKE) -C $@
install: $(SUBDIRS_BUILD)
- @$(ECHO) "INFO: installing in $(INSTALL_PREFIX) ..."
+ @$(ECHO) ">> INFO: installing in $(INSTALL_PREFIX) ..."
$(INSTALL_PC_MACRO) libseccomp.pc
@for dir in $(SUBDIRS_INSTALL); do \
- $(ECHO) "INFO: installing from $$dir/"; \
+ $(ECHO) ">> INFO: installing from $$dir/"; \
$(MAKE) -C $$dir install; \
done
ctags:
- @$(ECHO) "INFO: generating ctags for the project ..."
+ @$(ECHO) ">> INFO: generating ctags for the project ..."
@ctags -R *
cstags:
- @$(ECHO) "INFO: generating cscope tags for the project ..."
+ @$(ECHO) ">> INFO: generating cscope tags for the project ..."
@find -iname *.[ch] > cscope.files
@cscope -b -q -k
clean:
- @$(ECHO) "INFO: cleaning up libseccomp"
+ @$(ECHO) ">> INFO: cleaning up libseccomp"
@for dir in $(SUBDIRS_BUILD); do \
$(MAKE) -C $$dir clean; \
done
dist-clean: clean
- @$(ECHO) "INFO: removing the configuration files"
+ @$(ECHO) ">> INFO: removing the configuration files"
@$(RM) $(CONFIGS)
diff --git a/macros.mk b/macros.mk
index 6b589c3..6162900 100644
--- a/macros.mk
+++ b/macros.mk
@@ -128,56 +128,19 @@ LINK_LIB += $(GCC) $(LDFLAGS) -o $@ $^ -shared \
#
ifeq ($(V),0)
- INSTALL_MACRO = \
- @echo " INSTALL $$(cat /proc/$$$$/cmdline | awk '{print $$(NF-1)}')" \
- " ($$(cat /proc/$$$$/cmdline | awk '{print $$NF}'))";
+ INSTALL_LIB_MACRO = @echo " INSTALL $^ ($(INSTALL_LIB_DIR)/$^)";
endif
-INSTALL_MACRO += \
- $(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) -m 0644
-
-ifeq ($(V),0)
- INSTALL_SBIN_MACRO = @echo " INSTALL $^ ($(INSTALL_SBIN_DIR))";
-endif
-INSTALL_SBIN_MACRO += \
- $(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) \
- -d "$(INSTALL_SBIN_DIR)"; \
- $(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) -m 0644 \
- $^ "$(INSTALL_SBIN_DIR)"; \
-
-ifeq ($(V),0)
- INSTALL_BIN_MACRO = @echo " INSTALL $^ ($(INSTALL_BIN_DIR))";
-endif
-INSTALL_BIN_MACRO += \
- $(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) \
- -d "$(INSTALL_BIN_DIR)"; \
- $(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) -m 0644 \
- $^ "$(INSTALL_BIN_DIR)"; \
-
-
-INSTALL_LIB_MACRO = \
- @install_lib_func() { \
- dir="$(INSTALL_LIB_DIR)"; \
- if [[ -n "$$2" ]]; then \
- $(ECHO) " INSTALL $$2"; \
- else \
- $(ECHO) " INSTALL $^ ($$dir/$^)"; \
- fi; \
+INSTALL_LIB_MACRO += \
basename=$$(echo $^ | sed -e 's/.so.*$$/.so/'); \
soname=$$(objdump -p $^ | grep "SONAME" | awk '{print $$2}'); \
$(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) \
- -d "$$dir"; \
+ -d "$(INSTALL_LIB_DIR)"; \
$(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) -m 0755 \
- $^ "$$dir"; \
- if [[ "$$soname" != "$^" ]]; then \
- (cd "$$dir"; $(RM) -f $$soname); \
- (cd "$$dir"; $(LN) -s $^ $$soname); \
- fi; \
- if [[ "$$basename" != "$^" ]]; then \
- (cd "$$dir"; $(RM) -f $$basename); \
- (cd "$$dir"; $(LN) -s $^ $$basename); \
- fi; \
- }; \
- install_lib_func
+ $^ "$(INSTALL_LIB_DIR)"; \
+ (cd "$(INSTALL_LIB_DIR)"; $(RM) $$soname); \
+ (cd "$(INSTALL_LIB_DIR)"; $(LN) -s $^ $$soname); \
+ (cd "$(INSTALL_LIB_DIR)"; $(RM) $$basname); \
+ (cd "$(INSTALL_LIB_DIR)"; $(LN) -s $^ $$basename);
ifeq ($(V),0)
INSTALL_PC_MACRO = \
@@ -198,7 +161,7 @@ INSTALL_INC_MACRO += \
$(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) \
-d "$(INSTALL_INC_DIR)"; \
$(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) -m 0644 \
- $^ "$(INSTALL_INC_DIR)"; \
+ $^ "$(INSTALL_INC_DIR)";
ifeq ($(V),0)
INSTALL_MAN3_MACRO = @echo " INSTALL manpages
($(INSTALL_MAN_DIR)/man3)";
@@ -207,7 +170,7 @@ INSTALL_MAN3_MACRO += \
$(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) \
-d "$(INSTALL_MAN_DIR)/man3"; \
$(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) -m 0644 \
- $^ "$(INSTALL_MAN_DIR)/man3"; \
+ $^ "$(INSTALL_MAN_DIR)/man3";
#
# default build targets
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
libseccomp-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libseccomp-discuss