|
1 | 1 | #----------------------------------------------------------------------------- |
2 | | -# GNU makefile for building WCSLIB 6.2 and its test suite. |
| 2 | +# GNU makefile for building WCSLIB 6.4 and its test suite. |
3 | 3 | # |
4 | 4 | # Summary of the main targets |
5 | 5 | # --------------------------- |
|
31 | 31 | # |
32 | 32 | # Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. |
33 | 33 | # http://www.atnf.csiro.au/people/Mark.Calabretta |
34 | | -# $Id: GNUmakefile,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ |
| 34 | +# $Id: GNUmakefile,v 6.4 2019/08/15 09:30:18 mcalabre Exp $ |
35 | 35 | #----------------------------------------------------------------------------- |
36 | 36 | # Get configure settings. |
37 | 37 | SUBDIR := C |
@@ -81,27 +81,32 @@ TEST_P := tspc tprj2 tcel1 tcel2 ttab2 ttab3 twcsmix |
81 | 81 | # Test programs that require PGPLOT and PGSBOX. |
82 | 82 | TEST_B := tpih2 |
83 | 83 |
|
84 | | -# Test programs that aren't automatically exercised. |
| 84 | +# Test programs that are compiled but not automatically exercised. |
85 | 85 | TEST_X := tsphdpa twcshdr |
86 | 86 |
|
| 87 | + |
87 | 88 | TESTS := $(TEST_N) |
88 | 89 |
|
89 | | -# Add test programs that require CFITSIO if we have it. |
90 | | -ifneq "$(CFITSIOINC)" "" |
91 | | -ifneq "$(CFITSIOLIB)" "" |
| 90 | +# Do we have CFITSIO? |
| 91 | +ifeq "$(CFITSIOINC)$(CFITSIOLIB)" "" |
| 92 | + # No, amend TEST_X. |
| 93 | + TEST_X := $(filter-out $(TEST_C),$(TEST_X)) |
| 94 | +else |
| 95 | + # Yes, add test programs that use it. |
92 | 96 | TESTS += $(TEST_C) |
93 | 97 | CFITSIO_CFLAGS := $(filter-out -Wpadded,$(CFLAGS)) |
94 | 98 | endif |
95 | | -endif |
96 | 99 |
|
97 | | -# Add test programs that require PGPLOT if we have it. |
| 100 | +# Do we have PGPLOT? |
98 | 101 | ifneq "$(CHECK)" "nopgplot" |
99 | | -ifneq "$(PGPLOTINC)" "" |
100 | | -ifneq "$(PGPLOTLIB)" "" |
| 102 | +ifeq "$(PGPLOTINC)$(PGPLOTLIB)" "" |
| 103 | + # No, amend TEST_X. |
| 104 | + TEST_X := $(filter-out $(TEST_P) $(TEST_B),$(TEST_X)) |
| 105 | +else |
| 106 | + # Yes, add test programs that use it. |
101 | 107 | TESTS += $(TEST_P) $(TEST_B) |
102 | 108 | endif |
103 | 109 | endif |
104 | | -endif |
105 | 110 |
|
106 | 111 | # Remove tests that aren't automatically exercised. |
107 | 112 | TESTS := $(filter-out $(TEST_X), $(TESTS)) |
@@ -205,10 +210,10 @@ run_% : % |
205 | 210 | fi ; \ |
206 | 211 | echo 'PASS: C/$<' >> test_results ; \ |
207 | 212 | elif [ -f 'test/$<.out' ] ; then \ |
208 | | - trap 'rm -f run_test.tmp' 0 1 2 3 15 ; \ |
| 213 | + trap 'rm -f run_$<.tmp' 0 1 2 3 15 ; \ |
209 | 214 | sed -e 's/$(ADDRE)/0x<address>/g' $<.out > \ |
210 | | - run_test.tmp ; \ |
211 | | - mv -f run_test.tmp $<.out ; \ |
| 215 | + run_$<.tmp ; \ |
| 216 | + mv -f run_$<.tmp $<.out ; \ |
212 | 217 | if cmp -s $<.out test/$<.out ; then \ |
213 | 218 | if [ '$(MODE)' != interactive ] ; then \ |
214 | 219 | head -2 $<.out ; \ |
@@ -386,17 +391,17 @@ tpih2_cfitsio : test/tpih2.c $(PGSBOXLIB) $(WCSLIB) |
386 | 391 | $(CFITSIOLIB) $(WCSLIB) $(FLIBS) $(LIBS) |
387 | 392 | -@ $(RM) $@.o |
388 | 393 |
|
389 | | -twcstab : test/twcstab.c $(GETWCSTAB) $(WCSLIB) |
| 394 | +twcstab : test/twcstab.c $(WCSLIB) $(GETWCSTAB) |
390 | 395 | -@ echo '' |
391 | 396 | $(CC) $(CPPFLAGS) $(CFITSIOINC) $(CFITSIO_CFLAGS) -o $@ $< \ |
392 | 397 | $(GETWCSTAB) $(LDFLAGS) $(CFITSIOLIB) $(WCSLIB) $(LIBS) |
393 | | - -@ $(RM) $@.o |
| 398 | + -@ $(RM) $@.o $(GETWCSTAB) |
394 | 399 |
|
395 | | -twcshdr : test/twcshdr.c $(GETWCSTAB) $(WCSLIB) |
| 400 | +twcshdr : test/twcshdr.c $(WCSLIB) $(GETWCSTAB) |
396 | 401 | -@ echo '' |
397 | 402 | $(CC) $(CPPFLAGS) $(CFITSIOINC) $(CFITSIO_CFLAGS) -o $@ $< \ |
398 | 403 | $(GETWCSTAB) $(LDFLAGS) $(CFITSIOLIB) $(WCSLIB) $(LIBS) |
399 | | - -@ $(RM) $@.o |
| 404 | + -@ $(RM) $@.o $(GETWCSTAB) |
400 | 405 |
|
401 | 406 | tdis3 : test/tdis3 |
402 | 407 | -@ echo '' |
@@ -427,8 +432,10 @@ GNUmakefile : ../makedefs ; |
427 | 432 | cd .. && ./config.status |
428 | 433 |
|
429 | 434 | show :: |
430 | | - -@ -@ echo ' FLEXMODS := $(FLEXMODS)' |
431 | | - -@ -@ echo ' MODULES := $(MODULES)' |
| 435 | + -@ echo ' FLEXMODS := $(FLEXMODS)' |
| 436 | + -@ echo ' MODULES := $(MODULES)' |
| 437 | + -@ echo ' TESTS := $(TESTS)' |
| 438 | + -@ echo ' TEST_X := $(TEST_X)' |
432 | 439 |
|
433 | 440 | # Dependencies (use the %.d pattern rule to list them) |
434 | 441 | #----------------------------------------------------- |
|
0 commit comments