11# -----------------------------------------------------------------------------
2- # GNU makefile for building WCSLIB 4.25 and its test suite.
2+ # GNU makefile for building WCSLIB 5.6 and its test suite.
33#
44# Summary of the main targets
55# ---------------------------
1010# cleaner: clean, and also delete the test executables.
1111#
1212# cleanest (distclean or realclean): cleaner, and also delete the object
13- # library the C source files generated by 'flex'.
13+ # library and the C source files generated by 'flex'.
1414#
1515# check (or test): Compile and run the test programs. By default they are
1616# executed in batch mode, and non-graphical tests only report
3131#
3232# Author: Mark Calabretta, Australia Telescope National Facility, CSIRO.
3333# http://www.atnf.csiro.au/people/Mark.Calabretta
34- # $Id: GNUmakefile,v 4.25 2014/12 /14 14:29:36 mcalabre Exp $
34+ # $Id: GNUmakefile,v 5.6 2015/06 /14 07:11:24 mcalabre Exp $
3535# -----------------------------------------------------------------------------
3636# Get configure settings.
3737include ../makedefs
@@ -62,20 +62,15 @@ vpath %.in ..
6262
6363# For building and exercising the test suite
6464# ------------------------------------------
65- # Signals tfitshdr to use wcshdr().
66- ifneq "$(DO_WCSHDR ) " ""
67- CPPFLAGS += -DDO_WCSHDR
68- endif
69-
7065# Test programs that don't require CFITSIO or PGPLOT...
71- TEST_N := tlin tlog tprj1 tsph tsphdpa tspx ttab1 twcs twcssub tpih1 tbth1 \
72- tfitshdr tunits twcsfix twcscompare
66+ TEST_N := tlin tdis1 tlog tprj1 tsph tsphdpa tspx ttab1 twcs twcssub tpih1 \
67+ tbth1 tfitshdr tunits twcsfix twcscompare
7368
7469# ...and unofficial test programs.
7570TEST_n := tspcaips tspcspxe tspctrne twcs_locale
7671
7772# Test programs that require CFITSIO (they don't need PGPLOT).
78- TEST_C := twcstab twcshdr
73+ TEST_C := twcstab twcshdr twcslint
7974
8075# Test programs that require PGPLOT but not PGSBOX.
8176TEST_P := tspc tprj2 tcel1 tcel2 ttab2 ttab3 twcsmix
@@ -109,6 +104,8 @@ TESTS := $(filter-out $(TEST_X), $(TESTS))
109104
110105PGSBOXLIB := ../pgsbox/libpgsbox-$(LIBVER ) .a
111106
107+ ADDRE := 0x[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]*
108+
112109# Pattern rules
113110# --------------
114111
@@ -141,6 +138,9 @@ $(PICLIB)(%.o) : %.c
141138 -@ $(RM ) $@
142139 $(CPP ) $(CPPFLAGS ) $(CFLAGS ) $< > $@
143140
141+ % .fits : test/% .keyrec tofits
142+ ./tofits < $< > $@
143+
144144# Print out include file dependencies.
145145% .d : % .c
146146 -@ echo ' '
@@ -177,15 +177,21 @@ run_% : %
177177 ./$< < /dev/null > $< .out 2>&1 ; \
178178 fi ; \
179179 fi ; \
180- if grep ' PASS:' $< .out > /dev/null ; then \
180+ if grep ' FAIL:' $< .out > /dev/null ; then \
181+ if [ ' $(MODE)' != interactive ] ; then \
182+ head -2 $< .out ; \
183+ grep ' FAIL:' $< .out ; \
184+ fi ; \
185+ echo ' FAIL: C/$<' >> test_results ; \
186+ elif grep ' PASS:' $< .out > /dev/null ; then \
181187 if [ ' $(MODE)' != interactive ] ; then \
182188 head -2 $< .out ; \
183189 grep ' PASS:' $< .out ; \
184190 fi ; \
185191 echo ' PASS: C/$<' >> test_results ; \
186192 elif [ -f ' test/$<.out' ] ; then \
187193 trap ' rm -f run_test.tmp' 0 1 2 3 15 ; \
188- sed -e ' s/0x[0-9a-f][0-9a-f][0-9a-f]* /0x<address>/g' $< .out > \
194+ sed -e ' s/$(ADDRE) /0x<address>/g' $< .out > \
189195 run_test.tmp ; \
190196 mv -f run_test.tmp $< .out ; \
191197 if cmp -s $< .out test/$< .out ; then \
@@ -280,8 +286,10 @@ clean :
280286cleaner : clean
281287 - $(RM ) .gdb_history
282288 - $(RM ) $(TEST_N ) $(TEST_n ) $(TEST_X )
283- - $(RM ) $(TEST_P ) tpih2 twcstab twcshdr
284- - $(RM ) tofits bth.fits pih.fits wcstab.fits
289+ - $(RM ) $(TEST_P ) tpih2 twcstab twcshdr twcslint
290+ - $(RM ) tofits
291+ - $(RM ) bth.fits fitshdr.fits pih.fits wcslint.fits wcstab.fits
292+ - $(RM ) TPV3.fits TPV5.fits TPV7.fits SIP.fits
285293 - $(RM ) t* _cfitsio test_results
286294
287295cleanest distclean realclean : cleaner
@@ -337,6 +345,11 @@ twcshdr : test/twcshdr.c $(GETWCSTAB) $(WCSLIB)
337345 $(LDFLAGS ) $(CFITSIOLIB ) $(WCSLIB ) $(LIBS )
338346 -@ $(RM ) $@ .o
339347
348+ twcslint : test/twcslint
349+ -@ echo ' '
350+ cp $< .
351+ -@ chmod a+x $@
352+
340353getwcstab.o : getwcstab.c getwcstab.h
341354 -@ echo ' '
342355 $(CC ) $(CPPFLAGS ) $(CFLAGS ) $(CFITSIOINC ) -c $<
@@ -346,13 +359,7 @@ $(PGSBOXLIB) :
346359 $(MAKE ) -C ../pgsbox $(notdir $@ )
347360
348361tofits : test/tofits.c
349- $(CC ) $(CPPFLAGS ) $(CFLAGS ) -o $@ $<
350-
351- pih.fits : test/pih.keyrec tofits
352- ./tofits < $< > $@
353-
354- bth.fits : test/bth.keyrec tofits
355- ./tofits < $< > $@
362+ $(CC ) $(CPPFLAGS ) $(CFLAGS ) $(LDFLAGS ) -o $@ $<
356363
357364GNUmakefile : ../makedefs ;
358365
@@ -371,73 +378,80 @@ show ::
371378$(WCSLIB ) (cel.o) : cel.h prj.h sph.h wcsconfig.h wcserr.h wcsmath.h \
372379 wcsprintf.h wcstrig.h
373380$(WCSLIB ) (fitshdr.o) : wcsconfig.h fitshdr.h wcsutil.h
374- $(WCSLIB ) (lin.o) : lin.h wcserr.h wcsprintf.h
381+ $(WCSLIB ) (dis.o) : dis.h wcserr.h wcsprintf.h wcsutil.h
382+ $(WCSLIB ) (lin.o) : dis.h lin.h wcserr.h wcsprintf.h
375383$(WCSLIB ) (log.o) : log.h
376384$(WCSLIB ) (prj.o) : prj.h wcsconfig.h wcserr.h wcsmath.h wcsprintf.h \
377385 wcstrig.h wcsutil.h
378- $(WCSLIB ) (spc.o) : spc.h spx.h wcserr .h wcsmath .h wcsprintf.h wcstrig .h \
379- wcsutil.h
386+ $(WCSLIB ) (spc.o) : spc.h spx.h wcsconfig .h wcserr .h wcsmath .h \
387+ wcsprintf.h wcstrig.h wcsutil.h
380388$(WCSLIB ) (sph.o) : sph.h wcsconfig.h wcstrig.h
381389$(WCSLIB ) (spx.o) : spx.h wcserr.h wcsmath.h
382- $(WCSLIB ) (tab.o) : tab.h wcserr.h wcsmath.h wcsprintf.h
383- $(WCSLIB ) (wcs.o) : cel.h lin.h log.h prj.h spc.h sph.h spx.h tab .h \
384- wcs.h wcsconfig.h wcserr.h wcsmath.h wcsprintf .h \
385- wcstrig.h wcsunits.h wcsutil.h
386- $(WCSLIB ) (wcsbth.o) : cel.h lin.h prj.h spc.h spx.h tab.h wcs.h wcserr .h \
387- wcshdr .h wcsmath .h wcsutil.h
390+ $(WCSLIB ) (tab.o) : tab.h wcserr.h wcsmath.h wcsprintf.h wcsutil.h
391+ $(WCSLIB ) (wcs.o) : cel.h dis.h lin.h log.h prj.h spc.h sph.h spx.h \
392+ tab.h wcs.h wcsconfig.h wcserr.h wcsmath.h \
393+ wcsprintf.h wcstrig.h wcsunits.h wcsutil.h
394+ $(WCSLIB ) (wcsbth.o) : cel.h lin.h prj.h spc.h spx.h wcs.h wcshdr .h \
395+ wcsmath .h wcsprintf .h wcsutil.h
388396$(WCSLIB ) (wcserr.o) : wcserr.h wcsprintf.h
389- $(WCSLIB ) (wcsfix.o) : cel.h lin.h prj.h spc.h sph.h spx.h tab .h wcs .h \
390- wcserr.h wcsfix.h wcsmath.h wcsunits.h wcsutil.h
397+ $(WCSLIB ) (wcsfix.o) : cel.h lin.h prj.h spc.h sph.h spx.h wcs .h wcserr .h \
398+ wcsfix.h wcsmath.h wcsunits.h wcsutil.h
391399$(WCSLIB ) (wcshdr.o) : cel.h lin.h prj.h spc.h spx.h tab.h wcs.h wcserr.h \
392400 wcshdr.h wcsmath.h wcsutil.h
393- $(WCSLIB ) (wcspih.o) : cel.h lin.h prj.h spc.h spx.h tab.h wcs.h wcserr .h \
394- wcshdr .h wcsmath .h wcsutil.h
401+ $(WCSLIB ) (wcspih.o) : cel.h lin.h prj.h spc.h spx.h wcs.h wcshdr .h \
402+ wcsmath .h wcsprintf .h wcsutil.h
395403$(WCSLIB ) (wcsprintf.o) : wcsprintf.h
396404$(WCSLIB ) (wcstrig.o) : wcsconfig.h wcsmath.h wcstrig.h
397405$(WCSLIB ) (wcsulex.o) : wcserr.h wcsmath.h wcsunits.h wcsutil.h
398406$(WCSLIB ) (wcsunits.o) : wcserr.h wcsunits.h
399- $(WCSLIB ) (wcsutil.o) : wcsutil.h
407+ $(WCSLIB ) (wcsutil.o) : wcsmath.h wcsutil.h
400408$(WCSLIB ) (wcsutrn.o) : wcserr.h wcsunits.h
401409
402410tbth1 tbth1_cfitsio : cel.h lin.h prj.h spc.h spx.h tab.h wcs.h wcsconfig.h \
403411 wcsconfig_tests.h wcserr.h wcsfix.h wcshdr.h
404- tcel1 : cel.h prj.h wcserr.h
405- tcel2 : cel.h prj.h wcserr.h
412+ tcel1 : cel.h prj.h
413+ tcel2 : cel.h prj.h
406414tfitshdr tfitshdr_cfitsio : fitshdr.h wcsconfig.h wcsconfig_tests.h
407- tlin : lin.h wcserr.h
415+ tlin : lin.h
416+ tdis1 : cel.h dis.h lin.h prj.h spc.h spx.h wcs.h wcserr.h wcshdr.h \
417+ wcsprintf.h
408418tlog : log.h
409- tpih1 tpih1_cfitsio : cel.h lin.h prj.h spc.h spx.h tab.h wcs.h wcsconfig.h \
419+ tpih1 tpih1_cfitsio : cel.h lin.h prj.h spc.h spx.h wcs.h wcsconfig.h \
410420 wcsconfig_tests.h wcserr.h wcsfix.h wcshdr.h wcsprintf.h
411- tpih2 tpih2_cfitsio : cel.h lin.h prj.h spc.h spx.h tab.h wcs.h wcsconfig.h \
412- wcsconfig_tests.h wcserr.h wcshdr.h
413- tprj1 : prj.h wcsconfig.h wcserr.h wcstrig.h
414- tprj2 : prj.h wcserr.h
415- tspc : spc.h spx.h wcsconfig.h wcserr.h wcstrig.h
416- tspcaips : spc.h
417- tspctrne : spc.h wcserr.h
421+ tpih2 tpih2_cfitsio : cel.h lin.h prj.h spc.h spx.h wcs.h wcsconfig.h \
422+ wcsconfig_tests.h wcshdr.h
423+ tprj1 : prj.h wcsconfig.h wcstrig.h
424+ tprj2 : prj.h
425+ tspc : spc.h spx.h wcsconfig.h wcstrig.h
426+ tspcaips : spc.h spx.h
427+ tspctrne : spc.h spx.h wcserr.h
418428tsph : sph.h wcsconfig.h wcstrig.h
419429tsphdpa : sph.h
420- tspx : spx.h wcserr.h
421- ttab1 : tab.h wcserr.h
422- ttab2 : tab.h wcserr.h
423- ttab3 : prj.h tab.h wcserr.h
430+ tspx : spx.h
431+ ttab1 : tab.h
432+ ttab2 : tab.h
433+ ttab3 : prj.h tab.h
424434tunits : wcserr.h wcsunits.h
425- twcs : cel.h lin.h log.h prj.h spc.h sph.h spx.h tab.h wcs.h wcsconfig.h \
426- wcsconfig_tests.h wcserr.h wcsfix.h wcshdr.h wcslib.h wcsmath.h \
427- wcsprintf.h wcstrig.h wcsunits.h wcsutil.h
428- twcs_locale : wcs.h wcserr.h wcshdr.h wcsprintf.h
429- twcsfix : cel.h lin.h prj.h spc.h spx.h tab.h wcs.h wcserr.h wcsfix.h \
435+ twcs : cel.h fitshdr.h lin.h log.h prj.h spc.h sph.h spx.h tab.h wcs.h \
436+ wcsconfig.h wcsconfig_tests.h wcserr.h wcsfix.h wcshdr.h wcslib.h \
437+ wcsmath.h wcsprintf.h wcstrig.h wcsunits.h wcsutil.h
438+ twcs_locale : cel.h lin.h prj.h spc.h spx.h wcs.h wcserr.h wcshdr.h \
439+ wcsprintf.h
440+ twcsfix : cel.h lin.h prj.h spc.h spx.h wcs.h wcserr.h wcsfix.h wcsprintf.h \
430441 wcsunits.h
431442twcshdr : cel.h fitshdr.h getwcstab.h lin.h log.h prj.h spc.h sph.h spx.h \
432443 tab.h wcs.h wcsconfig.h wcserr.h wcsfix.h wcshdr.h wcslib.h \
433444 wcsmath.h wcsprintf.h wcstrig.h wcsunits.h wcsutil.h
434- twcsmix : cel.h lin.h prj.h spc.h sph.h spx.h tab.h wcs.h wcserr .h
435- twcssub : cel.h lin.h prj.h spc.h spx.h tab.h wcs.h wcserr.h
445+ twcsmix : cel.h lin.h prj.h spc.h sph.h spx.h wcs.h
446+ twcssub : cel.h lin.h prj.h spc.h spx.h wcs.h wcserr.h
436447twcstab : cel.h fitshdr.h getwcstab.h lin.h log.h prj.h spc.h sph.h spx.h \
437448 tab.h wcs.h wcsconfig.h wcserr.h wcsfix.h wcshdr.h wcslib.h \
438449 wcsmath.h wcsprintf.h wcstrig.h wcsunits.h wcsutil.h
439450
451+ run_tdis1 : TPV3.fits TPV5.fits TPV7.fits
440452run_tbth1 run_tbth1_cfitsio : bth.fits
441- run_tfitshdr run_tfitshdr_cfitsio : pih .fits
453+ run_tfitshdr run_tfitshdr_cfitsio : fitshdr .fits
442454run_tpih1 run_tpih1_cfitsio : pih.fits
443455run_tpih2 run_tpih2_cfitsio : pih.fits
456+ run_twcslint : wcslint.fits
457+ run_twcs_locale : pih.fits
0 commit comments