Sophie

Sophie

distrib > Fedora > 16 > i386 > by-pkgid > 053459a045fe24f944560ab72deae097 > files > 2

aunit-2010-3.fc16.src.rpm

--- a/Makefile	2011-03-25 21:14:36.423000860 +0300
+++ b/Makefile	2011-03-25 21:19:25.388001015 +0300
@@ -2,8 +2,10 @@
 TARGET =
 GPRBUILD  = gprbuild
 GPRCLEAN = gprclean
-
+DESTDIR ?= 
+GNATFLAGS ?= -XRUNTIME=$(RTS) -XPLATFORM=$(TARGET) $(CONF_ARGS)
 INSTALL = $(shell which $(GPRBUILD) 2> /dev/null | sed -e 's/\/bin\/gprbuild.*//')
+ADA_PROJECT_PATH ?= /usr/lib/gnat
 
 ifeq ($(RTS),)
    RTS=full
@@ -23,17 +25,17 @@
 
 # Install directories
 
-I_INC   = $(INSTALL)/include/aunit
-I_LIB   = $(INSTALL)/lib/aunit
-I_GPR   = $(INSTALL)/lib/gnat
-I_TPL   = $(INSTALL)/share/examples/aunit
-I_DOC   = $(INSTALL)/share/doc/aunit
-I_PLG   = $(INSTALL)/share/gps/plug-ins
+I_INC   = ${DESTDIR}/$(INSTALL)/include/aunit
+I_LIB   ?= ${DESTDIR}/$(INSTALL)/lib/aunit
+I_GPR   = ${DESTDIR}/${ADA_PROJECT_PATH}
+I_TPL   = ${DESTDIR}/$(INSTALL)/share/aunit/examples
+I_DOC   = ${DESTDIR}/$(INSTALL)/share/doc/aunit
+I_PLG   = ${DESTDIR}/$(INSTALL)/share/gps/plug-ins
 
 .PHONY: all clean targets installed-targets install_clean install
 
 all: support/aunit_shared.gpr
-	$(GPRBUILD) -Paunit/aunit_build -p -XRUNTIME=$(RTS) -XPLATFORM=$(TARGET) $(CONF_ARGS)
+	$(GPRBUILD) -Paunit/aunit_build -p ${GNATFLAGS}
 
 installed-targets:
 	@printf "$(TARGET)\n" >> installed-targets
@@ -83,20 +85,20 @@
 
 install: install_clean support/aunit_shared.gpr
 ifneq ($(INSTALL),)
-	$(MKDIR) $(I_DOC)
-	$(MKDIR) $(I_TPL)
-	$(MKDIR) $(I_PLG)
-	$(MKDIR) $(I_GPR)
-	$(MKDIR) $(I_LIB)
-	$(MKDIR) $(I_INC)
-	-$(CP) docs/*.html docs/*.info docs/*.pdf docs/*.txt $(I_DOC)
-	-$(CP) support/aunit.xml $(I_PLG)
-	$(CP) support/*.gpr $(I_GPR)
-	$(CP) -r examples/* $(I_TPL)
-	-$(CP) -r aunit/lib/* $(I_LIB)
-	$(CP) -r aunit/framework $(I_INC)
-	$(CP) -r aunit/containers $(I_INC)
-	$(CP) -r aunit/reporters $(I_INC)
+	$(MKDIR) /$(I_DOC)
+	$(MKDIR) /$(I_TPL)
+	$(MKDIR) /$(I_PLG)
+	$(MKDIR) /$(I_GPR)
+	$(MKDIR) /$(I_LIB)
+	$(MKDIR) /$(I_INC)
+	-$(CP) docs/*.html docs/*.info docs/*.pdf docs/*.txt /$(I_DOC)
+	-$(CP) support/aunit.xml /$(I_PLG)
+	$(CP) support/*.gpr /$(I_GPR)
+	$(CP) -r examples/* /$(I_TPL)
+	-$(CP) -r aunit/lib/* /$(I_LIB)
+	$(CP) -r aunit/framework /$(I_INC)
+	$(CP) -r aunit/containers /$(I_INC)
+	$(CP) -r aunit/reporters /$(I_INC)
 	@echo $(SRC_LIST)
 	@echo '------------------------------------------------------------------'
 	@echo '--  AUnit has now been installed.'