git » libfiu » commit 8362f97

Make preload/posix installable from the top level directory

author Alberto Bertogli
2009-06-15 03:56:41 UTC
committer Alberto Bertogli
2009-06-16 15:42:54 UTC
parent ed7cdcab959367a77ac887fb6bed09429790face

Make preload/posix installable from the top level directory

Also, while at it, clean the top level Makefile a little.

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>

Makefile +26 -13
preload/Makefile +22 -0
preload/posix/Makefile +8 -1

diff --git a/Makefile b/Makefile
index da76bf2..1e9e257 100644
--- a/Makefile
+++ b/Makefile
@@ -1,15 +1,34 @@
 
-all: default
 
-default: libfiu utils
+default: libfiu
+
+install: libfiu_install
+
+all: libfiu preload
+
+all_install: libfiu_install preload_install
+
 
 libfiu:
 	$(MAKE) -C libfiu
 
-install:
+libfiu_clean:
+	$(MAKE) -C libfiu clean
+
+libfiu_install:
 	$(MAKE) -C libfiu install
 
 
+
+preload: libfiu
+	$(MAKE) -C preload
+
+preload_clean:
+	$(MAKE) -C preload clean
+
+preload_install: preload
+	$(MAKE) -C preload install
+
 python2:
 	cd bindings/python && python setup.py build
 
@@ -26,18 +45,12 @@ python_clean:
 	cd bindings/python && rm -rf build/
 
 
-preload:
-	$(MAKE) -C preload
-
-preload_clean:
-	$(MAKE) -C preload clean
-
-clean: python_clean
-	$(MAKE) -C libfiu clean
+clean: python_clean preload_clean libfiu_clean
 
 
-.PHONY: default all clean libfiu utils \
+.PHONY: default all clean install all_install \
+	libfiu libfiu_clean libfiu_install \
 	python2 python2_install python3 python3_install python_clean \
-	preload preload_clean
+	preload preload_clean preload_install
 
 
diff --git a/preload/Makefile b/preload/Makefile
new file mode 100644
index 0000000..20698c7
--- /dev/null
+++ b/preload/Makefile
@@ -0,0 +1,22 @@
+
+default: all
+
+all: posix
+
+install: posix_install
+
+clean: posix_clean
+
+
+posix:
+	$(MAKE) -C posix/
+
+posix_clean:
+	$(MAKE) -C posix/ clean
+
+posix_install:
+	$(MAKE) -C posix/ install
+
+
+.PHONY: default clean install posix posix_clean posix_install
+
diff --git a/preload/posix/Makefile b/preload/posix/Makefile
index a25af76..411f61d 100644
--- a/preload/posix/Makefile
+++ b/preload/posix/Makefile
@@ -11,6 +11,9 @@ ifdef PROFILE
 ALL_CFLAGS += -g -pg -fprofile-arcs -ftest-coverage
 endif
 
+# prefix for installing the binaries
+PREFIX=/usr/local
+
 
 GEN_C = $(addsuffix .c,$(wildcard modules/*.mod))
 GEN_OBJS = $(addsuffix .o,$(wildcard modules/*.mod))
@@ -43,10 +46,14 @@ fiu_posix_preload.so: $(OBJS)
 	$(NICE_CC) $(ALL_CFLAGS) -shared -fPIC $(OBJS) -lfiu -ldl \
 		-o fiu_posix_preload.so
 
+install: fiu_posix_preload.so
+	install -d $(PREFIX)/lib
+	install -m 0755 fiu_posix_preload.so $(PREFIX)/lib
+
 clean:
 	rm -f $(OBJS) $(GEN_OBJS:.o=.c) fiu_posix_preload.so
 	rm -f *.bb *.bbg *.da *.gcov *.gcda *.gcno gmon.out
 
-.PHONY: default clean
+.PHONY: default install clean