| 1 | # compiler flags |
|---|
| 2 | CC=@CC@ |
|---|
| 3 | CFLAGS=@CFLAGS@ -ansi -pedantic -Wall |
|---|
| 4 | |
|---|
| 5 | # postgresql ... required |
|---|
| 6 | POSTGIS_INC=@POSTGIS_INC@ |
|---|
| 7 | POSTGIS_LIB=@POSTGIS_LIB@ |
|---|
| 8 | PGFLAGS=$(POSTGIS_INC) $(POSTGIS_LIB) |
|---|
| 9 | # libxml2 ... required |
|---|
| 10 | XML2_INC=@XML2_INC@ |
|---|
| 11 | XML2_LIB=@XML2_LIB@ |
|---|
| 12 | XMLFLAGS=$(XML2_INC) $(XML2_LIB) |
|---|
| 13 | |
|---|
| 14 | # fast-cgi ... optional |
|---|
| 15 | FCGI_INC=@FCGI_INC@ |
|---|
| 16 | FCGI_LIB=@FCGI_LIB@ |
|---|
| 17 | FCGIFLAGS=$(FCGI_INC) $(FCGI_LIB) |
|---|
| 18 | |
|---|
| 19 | # install path |
|---|
| 20 | PREFIX=@prefix@ |
|---|
| 21 | |
|---|
| 22 | SRC = $(wildcard src/*/*.c) |
|---|
| 23 | |
|---|
| 24 | all: |
|---|
| 25 | $(CC) $(CFLAGS) $(PGFLAGS) $(XMLFLAGS) $(FCGIFLAGS) $(SRC) -o tinyows |
|---|
| 26 | @rm -rf tinyows.dSYM |
|---|
| 27 | |
|---|
| 28 | svn-clean: clean doc-clean astyle |
|---|
| 29 | @find . -name '*~' -exec rm {} \; |
|---|
| 30 | @rm -f configure |
|---|
| 31 | |
|---|
| 32 | clean: |
|---|
| 33 | @rm -f tinyows Makefile src/ows_define.h |
|---|
| 34 | @rm -rf tinyows.dSYM |
|---|
| 35 | @rm -f demo/config.xml demo/install.sh |
|---|
| 36 | @rm -f test/config.xml test/install.sh |
|---|
| 37 | |
|---|
| 38 | install: |
|---|
| 39 | @echo "-----" |
|---|
| 40 | @echo "TinyOWS Schema install dir in $(PREFIX)/tinyows/schema" |
|---|
| 41 | mkdir -p $(PREFIX)/tinyows |
|---|
| 42 | cp -rf schema $(PREFIX)/tinyows/ |
|---|
| 43 | @echo "-----" |
|---|
| 44 | @echo "Now:" |
|---|
| 45 | @echo " 1) copy 'tinyows' binary to cgi-bin directory" |
|---|
| 46 | @echo " 2) - put a workable config.xml file in $(PREFIX) dir" |
|---|
| 47 | @echo " - OR launch 'make install-demo' as a superuser" |
|---|
| 48 | |
|---|
| 49 | install-demo: |
|---|
| 50 | @chmod +x demo/install.sh |
|---|
| 51 | @demo/install.sh |
|---|
| 52 | cp -i demo/config.xml $(PREFIX)/tinyows |
|---|
| 53 | |
|---|
| 54 | install-test: |
|---|
| 55 | @chmod +x test/install.sh |
|---|
| 56 | @test/install.sh |
|---|
| 57 | cp -i test/config.xml $(PREFIX)/tinyows |
|---|
| 58 | |
|---|
| 59 | doc-clean: |
|---|
| 60 | @rm -rf doc/doxygen |
|---|
| 61 | |
|---|
| 62 | doxygen: doc-clean |
|---|
| 63 | @(which doxygen 2> /dev/null > /dev/null \ |
|---|
| 64 | && mkdir -p doc/doxygen \ |
|---|
| 65 | && doxygen doc/Doxyfile \ |
|---|
| 66 | ) || echo "doxygen seems not installed" |
|---|
| 67 | |
|---|
| 68 | test-valgrind: |
|---|
| 69 | @test/unit_test test/wfs/cite_wfs_1_1_0-sf0 1 |
|---|
| 70 | |
|---|
| 71 | test-output: |
|---|
| 72 | @test/unit_test test/wfs/cite_wfs_1_1_0-sf0 3 |
|---|
| 73 | |
|---|
| 74 | test-http: |
|---|
| 75 | @test/unit_test test/wfs/cite_wfs_1_1_0-sf0 4 |
|---|
| 76 | |
|---|
| 77 | test-exception: |
|---|
| 78 | @test/unit_test test/wfs/cite_wfs_1_1_0-sf0 5 |
|---|
| 79 | |
|---|
| 80 | test-stderr: |
|---|
| 81 | @test/unit_test test/wfs/cite_wfs_1_1_0-sf0 6 |
|---|
| 82 | |
|---|
| 83 | |
|---|
| 84 | |
|---|
| 85 | astyle: |
|---|
| 86 | @(astyle -A4 -S -M -m -f -p -U -o -c $(SRC)) \ |
|---|
| 87 | || echo "astyle seems not installed" |
|---|