Ticket #40400: patch-make.diff
File patch-make.diff, 2.6 KB (added by fabian@…, 11 years ago) |
---|
-
Makefile
old new 14 14 # 15 15 # Usage: 16 16 # make [platform=<your platform>] [DEBUG=1] all 17 # make [platform=<your platform>] < installdir=/path/to/install> install17 # make [platform=<your platform>] <DESTDIR=/path/to/install> install 18 18 # This makefile will attempt to detect your platform if not supplied. 19 19 # 20 20 # Author: Charles Nepveu … … 45 45 PLATFORM :=$(shell [ -z "$(platform)" ] && uname | tr "[A-Z]" "[a-z]" || echo "$(platform)" ) 46 46 SUPPORTED_PLATFORMS=linux netbsd freebsd openbsd darwin sunos gogocpe 47 47 48 INSTALL_DIR :=$(installdir) 49 INSTALL_BIN :=$(INSTALL_DIR)/bin 50 INSTALL_MAN :=$(INSTALL_DIR)/man 51 INSTALL_TEMPL :=$(INSTALL_DIR)/template 48 DESTDIR :=$(DESTDIR) 49 INSTALL_BIN :=/bin 50 INSTALL_MAN :=/man 51 INSTALL_CONF :=/etc/gogoc 52 INSTALL_TEMPL :=$(INSTALL_CONF)/template 52 53 53 54 54 55 SUBDIRS=$(PWD)/src/lib \ … … 66 67 LD_LIBRARIES=-lgogocpal -lgogocconfig -lgogocmessaging 67 68 68 69 # Export these variables to sub-makes. 69 export PLATFORM_DIR PLATFORM BIN_DIR OBJS_DIR TARGET DEBUG CC_INC_PATHS LD_LIB_PATHS LD_LIBRARIES INSTALL_DIR INSTALL_BIN INSTALL_MAN INSTALL_TEMPL70 export PLATFORM_DIR PLATFORM BIN_DIR OBJS_DIR TARGET DEBUG CC_INC_PATHS LD_LIB_PATHS LD_LIBRARIES DESTDIR INSTALL_BIN INSTALL_MAN INSTALL_TEMPL DESTDIR 70 71 71 72 72 73 # … … 155 156 # This makefile target will install the gogoCLIENT. 156 157 # 157 158 check-gogoc-install: 158 @[ -n "$( INSTALL_DIR)" ] || { \159 @[ -n "$(DESTDIR)" ] || { \ 159 160 echo ; \ 160 161 echo "Error: You must specify the install directory"; \ 161 echo "Syntax: make [platform=<os-type>] installdir=</path/to/install> install"; \162 echo "Syntax: make [platform=<os-type>] DESTDIR=</path/to/install> install"; \ 162 163 echo ; \ 163 164 exit 1;\ 164 165 } 165 166 166 167 install: check-gogoc-install all 167 @mkdir -p $(INSTALL_DIR) 168 @mkdir -p $(INSTALL_BIN) 169 @mkdir -p $(INSTALL_MAN) 170 @mkdir -p $(INSTALL_TEMPL) 168 @mkdir -p $(DESTDIR) 169 @mkdir -p $(DESTDIR)$(INSTALL_BIN) 170 @mkdir -p $(DESTDIR)$(INSTALL_MAN) 171 @mkdir -p $(DESTDIR)$(INSTALL_TEMPL) 172 @mkdir -p $(DESTDIR)$(INSTALL_CONF) 171 173 172 174 @for dir in ${SUBDIRS}; do \ 173 175 $(MAKE) -C $$dir install || exit 1; \ 174 176 done 175 177 176 @cp $(TARGET) $( INSTALL_BIN)177 @cp $(BIN_DIR)/gogoc.conf.sample $( INSTALL_BIN)178 @[ -f $( INSTALL_BIN)/gogoc.conf ] || { \179 cp $( INSTALL_BIN)/gogoc.conf.sample $(INSTALL_BIN)/gogoc.conf; \178 @cp $(TARGET) $(DESTDIR)$(INSTALL_BIN) 179 @cp $(BIN_DIR)/gogoc.conf.sample $(DESTDIR)$(INSTALL_CONF) 180 @[ -f $(DESTDIR)$(INSTALL_CONF)/gogoc.conf ] || { \ 181 cp $(DESTDIR)$(INSTALL_CONF)/gogoc.conf.sample $(DESTDIR)$(INSTALL_CONF)/gogoc.conf; \ 180 182 } 181 183 182 184