changed the CC_OPTS and LD_FLAGS to CFLAGS, LDFLAGS, and LDLIBS
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 1 Sep 2005 16:15:27 +0000 (16:15 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 1 Sep 2005 16:15:27 +0000 (16:15 +0000)
so that MAKE can implicitly build .o files
(don't have to repeat build flags in makefiles)
makefiles are cleaner this way

git-svn-id: svn://svn.open-ils.org/ILS/trunk@1788 dcc99617-32d9-48b4-a31d-7c20da2025e4

16 files changed:
Makefile
Open-ILS/src/Makefile
Open-ILS/src/apachemods/Makefile
Open-ILS/src/apachemods/fieldmapper_lookup-gen.pl
OpenSRF/src/Makefile
OpenSRF/src/gateway/Makefile
OpenSRF/src/jserver/Makefile
OpenSRF/src/libstack/Makefile
OpenSRF/src/libtransport/Makefile
OpenSRF/src/objson/Makefile
OpenSRF/src/objson/json_parser.h
OpenSRF/src/objson/object.h
OpenSRF/src/router/Makefile
OpenSRF/src/srfsh/Makefile
OpenSRF/src/utils/Makefile
install.sh

index 3fca221..fbb6bc0 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -16,6 +16,9 @@
 
 all: build
 
+verbose:       oldconfig
+       @./install.sh build verbose
+
 config:        
        @./config.sh
 
index 59ed4c4..700a747 100644 (file)
@@ -1,6 +1,7 @@
+
 export TMPDIR                  = $(TMP)/opensrf
-export LD_OPTS                 = -L $(TMPDIR) -L .
-export CC_OPTS                 = -g -Wall -O2 -fPIC -I$(LIBXML2_HEADERS) -I$(APACHE2_HEADERS) \
+export LDFLAGS                 = -L $(TMPDIR) -L .
+export CFLAGS                  = -g -Wall -O2 -fPIC -I$(LIBXML2_HEADERS) -I$(APACHE2_HEADERS) \
                                                                -I$(LIBXML2_HEADERS)/libxml  -I$(TMP) -I$(TMPDIR)
 
 all: mod_xmltools mod_ils_rest_gateway
@@ -15,46 +16,46 @@ web-install:        webcore-install autojs-install  mod_xmltools-install mod_ils_rest_g
 # Web stuff
 # -----------------------------------------------------------------------------------
 mod_ils_rest_gateway:
-       echo $@
+       @echo $@
        make -C apachemods mod_ils_rest_gateway.so
 
 mod_ils_rest_gateway-install:
-       echo $@
+       @echo $@
        make -C apachemods mod_ils_rest_gateway-install
 
 mod_xmltools:
-       echo $@
+       @echo $@
        make -C apachemods mod_xmltools.so
 
 mod_xmltools-install:
-       echo $@
+       @echo $@
        make -C apachemods mod_xmltools-install
 
 webcore-install:
-       echo $@
+       @echo $@
        echo "Copying web into $(WEBDIR)"
        mkdir -p $(WEBDIR)
        cp -r ../web/* $(WEBDIR)
 
 autojs-install:
-       echo $@
+       @echo $@
        cp extras/fieldmapper.pl $(BINDIR)
        cp extras/org_tree_js.pl $(BINDIR)
        cp extras/autogen.sh $(BINDIR)
 # -----------------------------------------------------------------------------------
 
 marcdumper:
-       echo $@
+       @echo $@
        make -C extras/marcdumper
 
 marcdumper-install:
-       echo $@
+       @echo $@
        make -C extras/marcdumper install
 
 # -----------------------------------------------------------------------------------
 
 perl-install:
-       echo $@
+       @echo $@
        @echo "Installing Perl modules to $(PERLDIR)"
        mkdir -p $(PERLDIR)
        cp -r perlmods/* $(PERLDIR)
@@ -65,7 +66,6 @@ perl-install:
 # -----------------------------------------------------------------------------------
 
 storage-bootstrap:
-       echo $@
        @echo "Installing cgi's to $(CGIDIR)"
        mkdir -p $(CGIDIR)
        cp -r cgi-bin/* $(CGIDIR)
@@ -75,19 +75,17 @@ storage-bootstrap:
 
 
 string-templates-install:
-       echo $@
        @echo "Installing string templates to $(TEMPLATEDIR)"
        mkdir -p $(TEMPLATEDIR)
        cp -r templates/strings $(TEMPLATEDIR)
 
 xsl-install:   
-       echo $@
        @echo "Installing XSL files to $(XSLDIR)"
        mkdir -p $(XSLDIR)
        cp ../xsl/*.xsl $(XSLDIR)
 
 clean:
-       echo $@
+       @echo $@
        make -C extras clean
        make -C apachemods clean
 
index 306afa0..5e1b9cc 100644 (file)
@@ -1,41 +1,39 @@
-# ---------------------------------------------------------------------------------
-#CC_OPTS = -I /usr/include/libxml2 -I /opt/include -g
-#APXS2 = /home/erickson/sandbox/apache2/bin/apxs
-# ---------------------------------------------------------------------------------
 
-LD_OPTS        += -lxml2 -lc_utils -lxslt
+LDLIBS += -lxml2 -lopensrf -lxslt
 
 all:   mod_xmltools.so mod_ils_rest_gateway.so
 
 install:       mod_xmltools-install mod_ils_rest_gateway-install libfieldmapper-install
 
-mod_xmltools.so: apachetools.o  xmltools.o mod_xmltools.c mod_xmltools.h
-       echo $@
-       $(CC) -c $(CC_OPTS) mod_xmltools.c 
-       $(CC) $(LD_OPTS) -shared -W1 apachetools.o xmltools.o mod_xmltools.o -o $@
 
+mod_xmltools.o: mod_xmltools.c mod_xmltools.h
 apachetools.o: apachetools.c apachetools.h
-       echo $@
-       $(CC) -c $(CC_OPTS)  apachetools.c -o $@
-
-xmltools.o:    xmltools.c xmltools.h   
-       echo $@
-       $(CC) -c $(CC_OPTS) xmltools.c -o $@
+xmltools.o:    xmltools.c xmltools.h
+json_xml.o:    json_xml.c json_xml.h
+fieldmapper_lookup.o:  fieldmapper_lookup.c fieldmapper_lookup.h
+ils_rest_gateway.o:    mod_rest_gateway.c mod_rest_gateway.h
+       $(CC) -c $(CFLAGS) mod_rest_gateway.c -o $@
 
-fieldmapper_lookup.c:  fieldmapper_lookup.h
+fieldmapper_lookup.c:  
        ./fieldmapper_lookup-gen.pl fieldmapper_lookup.c
 
-json_xml.o:    json_xml.c json_xml.h
-       echo $@
-       $(CC) -c $(CC_OPTS) json_xml.c -o $@
 
-fieldmapper_lookup.o:  fieldmapper_lookup.c fieldmapper_lookup.h
+# ------------------------------------------------------
+
+mod_xmltools.so: mod_xmltools.o apachetools.o  xmltools.o 
        echo $@
-       $(CC) -c $(CC_OPTS) fieldmapper_lookup.c -o $@
+       $(CC) $(LDFLAGS) $(LDLIBS) -shared -W1 apachetools.o xmltools.o mod_xmltools.o -o $@
 
 libfieldmapper.so:     fieldmapper_lookup.o
        echo $@
-       $(CC) $(LD_OPTS) -shared -W1 fieldmapper_lookup.o -o $@
+       $(CC) $(LDFLAGS) $(LDLIBS) -shared -W1 fieldmapper_lookup.o -o $@
+
+mod_ils_rest_gateway.so:       libfieldmapper.so ils_rest_gateway.o
+       echo $@
+       $(CC) $(LDFLAGS) $(LDLIBS) -shared -W1 ils_rest_gateway.o -lfieldmapper -o $@
+
+# ------------------------------------------------------
+
 
 libfieldmapper-install:        libfieldmapper.so
        echo installing libfieldmapper.so
@@ -43,17 +41,8 @@ libfieldmapper-install:      libfieldmapper.so
        cp fieldmapper_lookup.h $(INCLUDEDIR)/
        cp libfieldmapper.so $(LIBDIR)/libfieldmapper.so
 
-ils_rest_gateway.o:     mod_rest_gateway.c mod_rest_gateway.h fieldmapper_lookup.h
-       echo $@
-       $(CC) -c $(CC_OPTS) mod_rest_gateway.c -o $@
-
-mod_ils_rest_gateway.so:     libfieldmapper.so ils_rest_gateway.o
-       echo $@
-       $(CC) $(LD_OPTS) -shared -W1 ils_rest_gateway.o -lfieldmapper -o $@
-
 
 mod_ils_rest_gateway-install:
-       echo $@
        $(APXS2) -i -a -n mod_ils_rest_gateway mod_ils_rest_gateway.so
        echo "-----------------------------------------------";
        echo -e "* Important * : Change httpd.conf from this: \n \
@@ -66,7 +55,6 @@ mod_ils_rest_gateway-install:
        echo ""
 
 mod_xmltools-install:
-       echo $@
        $(APXS2) -i -a -n mod_xmltools mod_xmltools.so
        echo "-----------------------------------------------";
        echo -e "* Important * : Change httpd.conf from this: \n \
@@ -85,3 +73,4 @@ clean:
        echo $@
        /bin/rm -f *.o xmltools mod_xmltools.so libfieldmapper.so mod_ils_rest_gateway.so
        /bin/rm -f fieldmapper_lookup.c
+
index 06ae767..f3ae179 100755 (executable)
@@ -83,5 +83,4 @@ for my $object (keys %$map) {
 }
 
 print SOURCE " return -1;\n}\n";
-warn  "done\n";
 
index 60ce608..5458e25 100644 (file)
@@ -1,12 +1,4 @@
 # TOP level 'src' makefile for OpenSRF
-#
-#
-
-# Change to suit...
-#export PREFIX                         = /usr
-#export APXS2                                  = /pines/apps/apache2/bin/apxs
-#export TMP                                    = /tmp/opensrf_build
-#export APACHE2_HEADERS        = /pines/apps/apache2/include 
 
 
 export TMPDIR                  = $(TMP)/opensrf
@@ -15,50 +7,97 @@ export BINDIR                        = $(PREFIX)/bin
 export LIBDIR                  = $(PREFIX)/lib
 export PERLDIR                 = $(LIBDIR)/perl5
 export INCLUDEDIR              = $(PREFIX)/include
-export CC                              = gcc
-export LD_OPTS                 = -L $(TMPDIR) -L .
-export CC_OPTS                 = -g -Wall -O2 -fPIC -I$(LIBXML2_HEADERS) -I$(APACHE2_HEADERS) \
-                                                               -I$(LIBXML2_HEADERS)/libxml  -I$(TMP) -I$(TMPDIR)
-
 
-all: prep router srfsh jserver gateway
+export LDLIBS                  += 
+export LDFLAGS                 += -L $(TMPDIR) -L .
+export CFLAGS                  += -g -Wall -O2 -fPIC -I$(LIBXML2_HEADERS) -I$(APACHE2_HEADERS) \
+                                                               -I$(LIBXML2_HEADERS)/libxml  -I$(TMP) -I$(TMPDIR)
 
-install: install-prep transport-install stack-install gateway-install  \
-               router-install srfsh-install jserver-install perl-install                       \
-               objson-install utils-install info
+LIBOPENSRF                             = libopensrf.so
+
+OPENSRF_TARGETS = libtransport/transport_session.o \
+                                               libtransport/transport_client.o \
+                                               libtransport/transport_message.o \
+                                               libstack/osrf_app_session.o \
+                                               libstack/osrf_stack.o \
+                                               libstack/osrfConfig.o \
+                                               libstack/osrf_settings.o \
+                                               libstack/osrf_message.o \
+                                               libstack/osrf_prefork.o \
+                                               libstack/osrf_system.o \
+                                               libstack/xml_utils.o \
+                                               utils/socket_bundle.o \
+                                               utils/string_array.o \
+                                               utils/utils.o \
+                                               utils/logging.o \
+                                               utils/md5.o \
+                                               utils/sha.o \
+
+OPENSRF_HEADERS = libtransport/transport_session.h \
+                                               libtransport/transport_client.h \
+                                               libtransport/transport_message.h \
+                                               libstack/osrf_app_session.h \
+                                               libstack/osrf_stack.h \
+                                               libstack/osrfConfig.h \
+                                               libstack/osrf_settings.h \
+                                               libstack/osrf_message.h \
+                                               libstack/osrf_prefork.h \
+                                               libstack/osrf_system.h \
+                                               libstack/xml_utils.h \
+                                               utils/socket_bundle.h \
+                                               utils/string_array.h \
+                                               utils/utils.h \
+                                               utils/logging.h \
+                                               utils/md5.h \
+                                               utils/sha.h \
+
+
+all: prep libopensrf.so router srfsh jserver gateway
+
+install: install-prep opensrf-install gateway-install  router-install \
+               srfsh-install jserver-install perl-install objson-install
 
 prep:
        mkdir -p $(TMPDIR)
 
-# --------------------------------------------------------------------------------
-# LIBS 
-# --------------------------------------------------------------------------------
-c_utils: prep
+libopensrf.so: objson/libobjson.so
+       @echo utils
        make -C utils
-
-transport: c_utils
+       @echo transport
        make -C libtransport
+       @echo stack
+       make -C libstack
+       @echo $@
+       $(CC) -shared -W1 $(LDFLAGS) -lobjson $(OPENSRF_TARGETS) -o $(TMPDIR)/$(LIBOPENSRF)
 
-objson: c_utils
-       make -C objson
 
-stack: objson transport 
-       make -C libstack
+opensrf-install:
+       @echo $@
+       cp $(TMPDIR)/$(LIBOPENSRF) $(LIBDIR)/$(LIBOPENSRF)
+       cp $(OPENSRF_HEADERS) $(INCLUDEDIR)/opensrf/
+
 
+objson/libobjson.so: 
+       @echo $@
+       make -C objson
 
 # --------------------------------------------------------------------------------
 # BINARIES
 # --------------------------------------------------------------------------------
-router: stack 
+router: libopensrf.so
+       @echo $@
        make -C router 
 
-srfsh: stack
+srfsh: libopensrf.so
+       @echo $@
        make -C srfsh
 
-gateway:       stack 
+gateway:       libopensrf.so
+       @echo $@
        make -C gateway
 
-jserver: c_utils
+jserver:       libopensrf.so
+       @echo $@
        make -C jserver
 
 
@@ -66,7 +105,7 @@ jserver: c_utils
 # INSTALL
 # --------------------------------------------------------------------------------
 install-prep:  
-       @echo "Creating install directories"
+       @echo $@
        mkdir -p $(LIBDIR)
        mkdir -p $(BINDIR)
        mkdir -p $(PERLDIR)
@@ -75,31 +114,32 @@ install-prep:
        mkdir -p $(ETCDIR)
        mkdir -p $(TEMPLATEDIR)
 
-transport-install:     install-prep utils-install
-       make -C libtransport install
-
-utils-install: install-prep
-       make -C utils install
-
-objson-install:        install-prep utils-install
+objson-install:        install-prep 
+       @echo $@
        make -C objson install
 
-stack-install: install-prep transport-install  objson-install
-       make -C libstack install
+libopensrf-install:    install-prep
+       @echo $@
+       cp $(TMPDIR)/$(LIBOPENSRF) $(LIBDIR)
 
-gateway-install:       install-prep stack-install      
+gateway-install:       install-prep opensrf-install    
+       @echo $@
        make -C gateway install
 
-router-install:        install-prep stack-install
+router-install:        install-prep opensrf-install
+       @echo $@
        make -C router install
 
-srfsh-install: install-prep stack-install 
+srfsh-install: install-prep opensrf-install 
+       @echo $@
        make -C srfsh install
 
-jserver-install:       install-prep utils-install
+jserver-install:       install-prep 
+       @echo $@
        make -C jserver install
 
 perl-install:  install-prep
+       @echo $@
        cp -r perlmods/* $(PERLDIR)/
        cp ../examples/bootstrap.conf.example $(ETCDIR)
        cp ../bin/opensrf_ctl $(BINDIR)
@@ -110,25 +150,10 @@ perl-install:     install-prep
 
 
 # --------------------------------------------------------------------------------
-# INFO
-# --------------------------------------------------------------------------------
-info:
-       @echo
-       @echo "OpenSRF is installed in $(PREFIX)"
-       @echo ""
-       @echo "It may be helpful to set some environment variables if the install "
-       @echo "was set to a non-standard location.  These include:"
-       @echo ""
-       @echo "export LD_LIBRARY_PATH=$(LIBDIR):\$$LD_LIBRARY_PATH"
-       @echo "export PERL5LIB=$(PERLDIR):\$$PERL5LIB"
-       @echo "export PATH=$(BINDIR):\$$PATH"
-       @echo ""
-
-
-# --------------------------------------------------------------------------------
 # CLEAN        
 # --------------------------------------------------------------------------------
 clean:
+       @echo $@
        make -C libtransport clean
        make -C libstack clean
        make -C router clean
@@ -137,6 +162,7 @@ clean:
        make -C utils clean
        make -C objson clean
        make -C srfsh clean
+       echo "Removing directory [$(TMPDIR)]"
        /bin/rm -rf $(TMPDIR)
 
 
index 74827bf..10d0b3e 100644 (file)
@@ -1,33 +1,15 @@
-# -------------------------------------------------------------------------------
-#CC_OPTS = -Wall -O2 -I /opt/include -I /openils/include -I /usr/include/libxml2
-#LD_OPTS = -L /openils/lib
-#APXS2 = /opt/bin/apxs
-#TMPDIR = /tmp/blah
-#ETCDIR = /tmp/blah
-# -------------------------------------------------------------------------------
+CCFLAGS        += -DASSUME_STATELESS
+LDLIBS += -lobjson -lxml2 -lopensrf
 
-CC_OPTS        += -DASSUME_STATELESS
-LD_OPTS        += -lc_utils -lobjson -lxml2 -lopensrf_transport -lopensrf_stack
-
-all: msg  ils_gateway 
-
-ils_gateway: libmod_ils_gateway.so
-
-msg:
-       echo "-> $$(pwd)"       
+all: libmod_ils_gateway.so
 
 install: 
-       echo installing ils_gateway
        $(APXS2) -i -a -n ils_gateway libmod_ils_gateway.so
 
 libmod_ils_gateway.so: mod_ils_gateway.o
-       echo $@
-       $(CC) $(LD_OPTS) -shared -W1 mod_ils_gateway.o -o libmod_ils_gateway.so
-
+       $(CC) -shared -W1 mod_ils_gateway.o -o libmod_ils_gateway.so
 
-mod_ils_gateway.o:     mod_ils_gateway.c       
-       echo $@
-       $(CC) -c $(CC_OPTS)  mod_ils_gateway.c
+mod_ils_gateway.o: mod_ils_gateway.h mod_ils_gateway.c 
 
 clean:
        /bin/rm -f *.o *.so 
index a13df1a..085ced5 100644 (file)
@@ -1,34 +1,19 @@
-LD_OPTS        += -lc_utils -lxml2
-OBJECTS                = jserver-c.o jserver-c_main.o jserver-c_session.o
+LDLIBS += -lopensrf -lobjson -lxml2
+OBJECTS        = jserver-c.o jserver-c_main.o jserver-c_session.o
 
-
-all: msg jserver-c 
-
-msg: 
-       echo "-> $$(pwd)"       
+all: jserver-c 
 
 jserver-c: $(OBJECTS)
-       echo $@
-       $(CC) $(LD_OPTS) $(OBJECTS) -o $@
+#      $(CC) $(LD_OPTS) $(OBJECTS) -o $@
 
 jserver-c_main.o: jserver-c_main.c 
-       echo $@
-       $(CC) -c $(CC_OPTS) jserver-c_main.c -o $@
-
 jserver-c.o: jserver-c.c jserver-c.h
-       echo $@
-       $(CC) -c $(CC_OPTS) jserver-c.c -o $@
-
 jserver-c_session.o: jserver-c_session.c jserver-c_session.h
-       echo $@
-       $(CC) -c $(CC_OPTS) jserver-c_session.c -o $@
 
 
 install: 
-       echo installing jserver
        cp jserver-c $(BINDIR)
 
-
 clean:
        /bin/rm -f *.o jserver-c 
 
index 93c4cb5..0579807 100644 (file)
@@ -1,63 +1,27 @@
-CC_OPTS                +=  -DASSUME_STATELESS 
-LD_OPTS += -lxml2 -lopensrf_transport  -lopensrf_stack -lobjson -lc_utils
+
+CFLAGS +=  -DASSUME_STATELESS 
+LDLIBS += -lxml2 -lobjson 
 
 TARGETS = osrf_message.o osrf_app_session.o osrf_stack.o osrf_system.o osrf_settings.o osrf_prefork.o osrfConfig.o xml_utils.o
 HEADERS = osrf_message.h osrf_app_session.h osrf_stack.h osrf_system.h osrf_settings.h osrf_prefork.h osrfConfig.h xml_utils.h
 
-all: msg xml_utils.o libopensrf_stack.so  
-
-msg: 
-       echo "-> $$(pwd)"       
-
-test:  test.o
-       echo $@
-       $(CC) $(LD_OPTS) test.o xml_utils.o -o $@
-
-test.o:        test.c xml_utils.o
-       echo $@
-       $(CC) -c $(CC_OPTS) test.c -o $@ 
+all: xml_utils.o $(TARGETS) copy
 
 xml_utils.o:
-       echo $@
        cp ../utils/xml_utils.h .
        cp ../utils/xml_utils.c .
-       $(CC) -c $(CC_OPTS) xml_utils.c -o $@ 
+       $(CC) -c $(CFLAGS) xml_utils.c -o $@ 
 
-# -------------------------------------------------------------
-
-
-libopensrf_stack.so: $(TARGETS)
-       echo $@
-       $(CC) -shared -W1 $(TARGETS) -o libopensrf_stack.so
-       $(CC) -shared -W1 $(TARGETS) -o $(TMPDIR)/libopensrf_stack.so
+copy:
        cp $(HEADERS) $(TMPDIR)/
 
 osrf_message.o:        osrf_message.c osrf_message.h
-       echo $@; $(CC) -c $(CC_OPTS) osrf_message.c -o $@
-
 osrf_app_session.o:    osrf_app_session.c osrf_app_session.h
-       echo $@; $(CC) -c $(CC_OPTS) osrf_app_session.c -o $@
-
 osrf_stack.o:  osrf_stack.c osrf_stack.h
-       echo $@; $(CC) -c $(CC_OPTS) osrf_stack.c -o $@
-
 osrf_system.o: osrf_system.c osrf_system.h
-       echo $@; $(CC) -c $(CC_OPTS) osrf_system.c -o $@
-
 osrf_settings.o:       osrf_settings.c osrf_settings.h
-       echo $@; $(CC) -c $(CC_OPTS) osrf_settings.c -o $@
-
 osrf_prefork.o:        osrf_prefork.c osrf_prefork.h
-       echo $@; $(CC) -c $(CC_OPTS) osrf_prefork.c -o $@
-
-
 osrfConfig.o:  osrfConfig.c osrfConfig.h xml_utils.o
-       echo $@; $(CC) -c $(CC_OPTS) osrfConfig.c -o $@
-
-install:
-       echo installing libopensrf_stack.so
-       cp $(HEADERS) $(INCLUDEDIR)/$(OPENSRF)
-       cp $(TMPDIR)/libopensrf_stack.so $(LIBDIR)/
 
 clean:
        /bin/rm -f *.o libopensrf_stack.so test xml_utils.h xml_utils.c
index 456a3da..643e81c 100644 (file)
@@ -1,42 +1,18 @@
-# set this shell variable prior to calling make to run with malloc_check enabled
-#MALLOC_CHECK_=1 # XXX debug only
 
-LD_OPTS        += -lxml2 -lc_utils 
-
-SOURCES        = transport_session.c transport_message.c transport_client.c
 TARGETS        = transport_message.o transport_session.o transport_client.o 
 HEADERS        = transport_message.h transport_session.h transport_client.h 
 
 TARGET = libopensrf_transport.so
 
-all:   msg libopensrf_transport.so
-
-msg:
-       echo "-> $$(pwd)"       
+all:   $(TARGETS) copy
 
-libopensrf_transport.so:  $(TARGETS)
-       echo $@
-       $(CC) -shared -W1 $(LD_OPTS) $(TARGETS) -o libopensrf_transport.so
-       $(CC) -shared -W1 $(LD_OPTS) $(TARGETS) -o $(TMPDIR)/libopensrf_transport.so
+copy:
        cp $(HEADERS) $(TMPDIR)
 
 transport_session.o:   transport_session.c transport_session.h
-       echo $@
-       $(CC) -c $(CC_OPTS) transport_session.c -o $@
-
 transport_message.o:   transport_message.c transport_message.h
-       echo $@
-       $(CC) -c $(CC_OPTS) transport_message.c -o $@
-
 transport_client.o:    transport_client.c transport_client.h
-       echo $@
-       $(CC) -c $(CC_OPTS) transport_client.c -o $@
 
-install:
-       echo installing $(TARGET)
-       cp $(TMPDIR)/libopensrf_transport.so $(LIBDIR)/
-       cp $(HEADERS) $(INCLUDEDIR)/$(OPENSRF)
 
 clean:
-       echo $@
-       /bin/rm -f *.o libopensrf_transport.so
+       /bin/rm -f *.o 
index f55f27e..5cf18da 100644 (file)
 #
 # --------------------------------------------------------------------
 
-OBJS                   = object.o json_parser.o utils.o
-UTIL_DIR               = ../utils
-DEST_INCLUDE = objson
-CC_OPTS                += -DSTRICT_JSON_WRITE #-DSTRICT_JSON_READ
+OBJS                           = utils.o object.o json_parser.o 
+UTIL_DIR                       = ../utils
+DEST_INCLUDE   = objson
+CFLAGS                 += -DSTRICT_JSON_WRITE #-DSTRICT_JSON_READ
 
-# -------------
-#CC_OPTS               += -I ../utils/
-#LD_OPTS += -L .
-#TMPDIR = .
-# -------------
+JSON_HEADERS = object.h json_parser.h
 
-all:   msg test
+all:   test
 
-msg: 
-       echo "-> $$(pwd)"       
+test: libobjson.so objson_test.o
 
-test: libobjson.so
-       echo $@
-       $(CC) $(CC_OPTS) $(LD_OPTS) -lobjson objson_test.c -o $@
+objson_test.o: objson_test.c 
+object.o:      object.h object.c
+json_parser.o: json_parser.h json_parser.c
 
 install:
-       echo installing libobjson.so
        mkdir -p $(INCLUDEDIR)/$(DEST_INCLUDE)
        cp $(TMPDIR)/$(DEST_INCLUDE)/*.h $(INCLUDEDIR)/objson/
        cp $(TMPDIR)/libobjson.so $(LIBDIR)/libobjson.so
 
 libobjson.so:  $(OBJS)
-       echo $@
        $(CC) -shared -W1 $(OBJS) -o $(TMPDIR)/libobjson.so
        $(CC) -shared -W1 $(OBJS) -o libobjson.so
        mkdir -p $(TMPDIR)/$(DEST_INCLUDE)/
-       cp *.h $(TMPDIR)/$(DEST_INCLUDE)/
-
-object.o:      object.h object.c
-       echo $@
-       $(CC) -c $(CC_OPTS) object.c -o $@
-
-json_parser.o: json_parser.h json_parser.c
-       echo $@
-       $(CC) -c $(CC_OPTS) json_parser.c -o $@
+       cp $(JSON_HEADERS) $(TMPDIR)/$(DEST_INCLUDE)/
 
 utils.o:       $(UTIL_DIR)/utils.h $(UTIL_DIR)/utils.c
-       echo $@
-       $(CC) -c $(CC_OPTS) $(UTIL_DIR)/utils.c -o $@
+       cp $(UTIL_DIR)/utils.h .
+       cp $(UTIL_DIR)/utils.c .
+       $(CC) -c $(CFLAGS) utils.c -o $@
 
 clean:
-       /bin/rm -f *.o *.so test libobjson.so
+       /bin/rm -f *.o *.so utils.c utils.h libobjson.so
+
index 6beec62..e47a429 100644 (file)
@@ -24,7 +24,7 @@ GNU General Public License for more details.
 
 #include <stdio.h>
 #include "object.h"
-#include "opensrf/utils.h"
+#include "utils.h"
 
 
 
index 41a2ccf..64168b9 100644 (file)
@@ -26,7 +26,7 @@ GNU General Public License for more details.
 #include <stdlib.h>
 #include <string.h>
 
-#include "opensrf/utils.h"
+#include "utils.h"
 
 /* json object types */
 #define JSON_HASH      0
index cd1e3ec..256c594 100644 (file)
@@ -1,22 +1,15 @@
-# set this shell variable prior to calling make to run with malloc_check enabled
 #MALLOC_CHECK_=1 # XXX debug only
 
-LD_OPTS                += -lc_utils -lxml2 -lopensrf_stack -lobjson
-LP                             = ../libtransport
-LIB_SOURCES = $(LP)/transport_session.c $(LP)/transport_message.c $(LP)/transport_client.c 
+LDLIBS += -lxml2 -lopensrf -lobjson
+CFLAGS += -D_ROUTER
 
-all: msg router 
-
-msg: 
-       echo "-> $$(pwd)"       
+all: router 
 
 install: 
-       echo installing router
        cp router $(BINDIR)
 
-router:  router.c $(LIB_SOURCES)
-       echo $@
-       $(CC) $(LD_OPTS) -D_ROUTER $(CC_OPTS)   $(LIB_SOURCES) router.c -o $@ 
+router:        router.o 
+router.o:      router.c router.h
 
 clean:
        /bin/rm -f *.o router
index fe90f61..163818e 100644 (file)
@@ -1,19 +1,15 @@
 # if EXEC_DEFAULT is defined, then srfsh will send all unknown commands to the shell for execution
 
-LD_OPTS        += -lobjson -lreadline -lxml2 -lopensrf_transport -lopensrf_stack -lncurses -lc_utils -DEXEC_DEFAULT
+LDLIBS += -lobjson -lreadline -lxml2 -lopensrf -lncurses 
+LDFLAGS        += -DEXEC_DEFAULT
 
-all: msg srfsh
+all: srfsh
 
-msg: 
-       echo "-> $$(pwd)"       
+srfsh: srfsh.o
+srfsh.o:       srfsh.c srfsh.h
 
 install: 
-       echo installing srfsh
        cp srfsh $(BINDIR)
 
-srfsh: srfsh.c srfsh.h
-       echo $@
-       $(CC) $(CC_OPTS) $(LD_OPTS) srfsh.c -o $@
-
 clean:
        /bin/rm -f *.o srfsh
index 4433364..01068ba 100644 (file)
@@ -1,66 +1,22 @@
-# ------------------------------------------------------------------------
-#CC_OPTS = -O2 -Wall 
-#TMPDIR = ./tmp
-# ------------------------------------------------------------------------
 
+UTIL_HEADERS = logging.h utils.h socket_bundle.h md5.h sha.h string_array.h xml_utils.h
+UTIL_OBJECTS = logging.o utils.o socket_bundle.o md5.o sha.o string_array.o 
 
-UTIL_SOURCES = logging.c utils.c socket_bundle.c md5.c sha.c string_array.c
-UTIL_HEADERS = logging.h utils.h socket_bundle.h md5.h sha.h string_array.h
-UTIL_OBJECTS = logging.o utils.o socket_bundle.o md5.o sha.o string_array.o
+all:   $(UTIL_OBJECTS) copy
 
-all:   msg libc_utils.so 
-
-msg:
-       echo "-> $$(pwd)"       
-
-
-install: 
-       echo installing libc_utils.so
-       cp $(UTIL_HEADERS) $(INCLUDEDIR)/$(OPENSRF)/
-       cp xml_utils.h $(INCLUDEDIR)/$(OPENSRF)/
-       cp $(TMPDIR)/libc_utils.so $(LIBDIR)/
-
-libc_utils.so: $(UTIL_OBJECTS) 
-       @echo $@
-       $(CC) -shared -W1 $(UTIL_OBJECTS) -o libc_utils.so
-       $(CC) -shared -W1 $(UTIL_OBJECTS) -o $(TMPDIR)/libc_utils.so
-       cp $(UTIL_HEADERS) $(TMPDIR)/
+copy:
+       cp $(UTIL_HEADERS) $(TMPDIR)
 
 logging.o: logging.c logging.h
-       @echo $@
-       $(CC) -c $(CC_OPTS) logging.c -o $@ 
-
 utils.o: utils.c utils.h
-       @echo $@
-       $(CC) -c $(CC_OPTS) utils.c -o $@ 
-
 socket_bundle.o: socket_bundle.c socket_bundle.h
-       @echo $@
-       $(CC) -c $(CC_OPTS) socket_bundle.c -o $@ 
-
 md5.o: md5.c md5.h
-       @echo $@
-       $(CC) -c $(CC_OPTS) md5.c -o $@ 
-
 sha.o: sha.c sha.h
-       @echo $@
-       $(CC) -c $(CC_OPTS) sha.c -o $@ 
-
 string_array.o: string_array.c string_array.h
-       @echo $@
-       $(CC) -c $(CC_OPTS) string_array.c -o $@ 
 
 
-clean:
-       /bin/rm -f *.o socket_test libc_utils.so test
-
 
-
-
-#fieldmapper: fieldmapper-c.pl
-#perl fieldmapper-c.pl $(FM_HEADER) $(FM_SOURCE)
-#$(CC) -c $(CC_OPTS) fieldmapper.c -o fieldmapper.o
-#$(CC) -shared -W1 fieldmapper.o -o $(LIBDIR)/libopensrf_fm.so
-#cp $(FM_HEADER) $(HEADER_DIR)/
+clean:
+       /bin/rm -f *.o 
 
 
index ee4016f..4cbe98f 100755 (executable)
@@ -20,6 +20,7 @@
 # --------------------------------------------------------------------
 CONFIG_FILE="install.conf";
 DEFAULT_CONFIG_FILE="install.conf.default";
+verbose="-s" #clear this to get full build output
 
 
 # --------------------------------------------------------------------
@@ -120,7 +121,7 @@ function runInstall {
                echo "-------------- [ $target ] -------------------------------------------";
                echo ""
 
-               MAKE="make -s APXS2=$APXS2 PREFIX=$PREFIX TMP=$TMP \
+               MAKE="make $verbose APXS2=$APXS2 PREFIX=$PREFIX TMP=$TMP \
                        APACHE2_HEADERS=$APACHE2_HEADERS LIBXML2_HEADERS=$LIBXML2_HEADERS \
                        BINDIR=$BINDIR LIBDIR=$LIBDIR PERLDIR=$PERLDIR INCLUDEDIR=$INCLUDEDIR \
                        WEBDIR=$WEBDIR TEMPLATEDIR=$TEMPLATEDIR ETCDIR=$ETCDIR \
@@ -241,6 +242,9 @@ function checkParams {
 
                        "install")
                                INSTALLING="1";;
+                       
+                       "verbose")
+                               verbose="";;
 
                        *) fail "Unknown option => $arg";
                esac
@@ -252,9 +256,9 @@ function checkParams {
 
 function cleanMe {
        loadConfig;
-       make -s -C "$OPENSRFDIR" clean;
-       make -s -C "$OPENILSDIR"  clean;
-       make -s -C "$EVERGREENDIR" clean;
+       make "TMP=$TMP" -s -C "$OPENSRFDIR" clean;
+       make "TMP=$TMP" -s -C "$OPENILSDIR"  clean;
+       make "TMP=$TMP" -s -C "$EVERGREENDIR" clean;
 }
 
 function usage {