changeset 578:d89a7b85528d trunk

[svn] buildsystem improvements
author nenolod
date Thu, 02 Feb 2006 16:12:08 -0800
parents 85bcdcbc245f
children 785ec2ad4ea4
files mk/objective.mk
diffstat 1 files changed, 27 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/mk/objective.mk	Thu Feb 02 16:03:51 2006 -0800
+++ b/mk/objective.mk	Thu Feb 02 16:12:08 2006 -0800
@@ -1,6 +1,9 @@
 # Shut up GNU make
 .SILENT:
 
+OBJECTIVE_DIRECTORIES = none
+OBJECTIVE_LIBS = none
+OBJECTIVE_BINS = none
 SUBDIRS = none
 CFLAGS += -DHAVE_CONFIG_H
 
@@ -9,18 +12,25 @@
 
 install:
 	$(MAKE) install-prehook
-	@for i in $(OBJECTIVE_DIRECTORIES); do \
-		printf "%10s     %-20s\n" MKDIR $$i; \
-		$(INSTALL) -d -m 755 $(DESTDIR)/$$i; \
-	done
-	@for i in $(OBJECTIVE_LIBS); do \
-		printf "%10s     %-20s\n" INSTALL $$i; \
-		$(INSTALL) $(INSTALL_OVERRIDE) $(DESTDIR)/$(LIBDIR)/$(LIB_SUFFIX)/$$i; \
-	done
-	@for i in $(OBJECTIVE_BINS); do \
-		printf "%10s     %-20s\n" INSTALL $$i; \
-		$(INSTALL) $(INSTALL_OVERRIDE) $(DESTDIR)/$(BINDIR)/$(LIB_SUFFIX)/$$i; \
-	@done
+	$(INSTALL) -d -m 755 $(DESTDIR)/$(LIBDIR)
+	@if test "$(OBJECTIVE_DIRECTORIES)" != "none"; then \
+		for i in $(OBJECTIVE_DIRECTORIES); do \
+			printf "%10s     %-20s\n" MKDIR $$i; \
+			$(INSTALL) -d -m 755 $(DESTDIR)/$$i; \
+		done; \
+	fi
+	@if test "$(OBJECTIVE_LIBS)" != "none"; then \
+		for i in $(OBJECTIVE_LIBS); do \
+			printf "%10s     %-20s\n" INSTALL $$i; \
+			$(INSTALL) $(INSTALL_OVERRIDE) $$i $(DESTDIR)/$(LIBDIR)/$$i; \
+		done; \
+	fi
+	@if test "$(OBJECTIVE_BINS)" != "none"; then \
+		for i in $(OBJECTIVE_BINS); do \
+			printf "%10s     %-20s\n" INSTALL $$i; \
+			$(INSTALL) $(INSTALL_OVERRIDE) $$i $(DESTDIR)/$(BINDIR)/$$i; \
+		done; \
+	fi;
 	$(MAKE) install-posthook
 	@echo "[all objectives installed]"
 
@@ -82,6 +92,11 @@
 	printf "%10s     %-20s\n" CXX $<;
 	$(CXX) $(CXXFLAGS) -c $< -o $@
 
+%.so: $(OBJECTS)
+	make $(OBJECTS)
+	printf "%10s     %-20s\n" LINK $@
+	$(CC) -fPIC -DPIC -shared -o $@ $(OBJECTS) $(LDFLAGS) $(LIBADD)
+
 clean-prehook:
 clean-posthook:
 build-prehook: