]> granicus.if.org Git - postgis/commitdiff
Updated to have C API tests use libtool
authorBborie Park <bkpark at ucdavis.edu>
Wed, 14 Mar 2012 20:26:07 +0000 (20:26 +0000)
committerBborie Park <bkpark at ucdavis.edu>
Wed, 14 Mar 2012 20:26:07 +0000 (20:26 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@9500 b70326c6-7e19-0410-871a-916f4a2858ee

raster/test/core/Makefile.in

index eadde58d7c34706fcf7b2b45ea3192286bd97ec6..3bae040c945b8ef21fdcf40505db58456dd8111c 100644 (file)
@@ -1,6 +1,8 @@
 #############################################################################
 # $Id$
 #
+# Copyright (c) 2012 Regents of the University of California
+#   <bkpark@ucdavis.edu>
 # Copyright (c) 2009 Sandro Santilli <strk@keybit.net>
 #
 # This is free software; you can redistribute and/or modify it under
@@ -8,6 +10,10 @@
 #
 #############################################################################
 
+# Filenames with extension as determined by the OS
+TESTAPI=testapi@EXESUFFIX@
+TESTWKB=testwkb@EXESUFFIX@
+
 RT_CORE=../../rt_core
 
 LIBLWGEOM_LDFLAGS=../../../liblwgeom/.libs/liblwgeom.a
@@ -37,26 +43,30 @@ LDFLAGS = \
        $(GEOS_LDFLAGS) \
        -lm \
        
+all: $(TESTAPI) $(TESTWKB)
 
-TESTS = testapi testwkb
-
-all: $(TESTS)
-
-check: $(RT_CORE)/librtcore.a $(TESTS)
+check: $(RT_CORE)/librtcore.a $(TESTAPI) $(TESTWKB)
        ./testapi
        ./testwkb
 
-testapi: $(RT_CORE)/librtcore.a testapi.c
-       $(CC) $(CFLAGS) -o testapi testapi.c $(LDFLAGS) 
+testapi.o: testapi.c
+       $(CC) $(CFLAGS) -c $<
+
+$(TESTAPI): testapi.o $(RT_CORE)/librtcore.a
+       $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@
+
+testwkb.o: testwkb.c
+       $(CC) $(CFLAGS) -c $<
 
-testwkb: $(RT_CORE)/librtcore.a testwkb.c
-       $(CC) $(CFLAGS) -o testwkb testwkb.c $(LDFLAGS) 
+$(TESTWKB): testwkb.o $(RT_CORE)/librtcore.a
+       $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@
 
 $(RT_CORE)/librtcore.a:
        $(MAKE) -C ../../rt_core
 
 clean:
-       $(RM) $(TESTS)
+       rm -rf .libs
+       $(RM) *.o $(TESTAPI) $(TESTWKB)
 
 distclean: clean
        $(RM) Makefile