File: GNUmakefile

package info (click to toggle)
wcslib 7.4%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 9,752 kB
  • sloc: ansic: 32,656; lex: 9,281; fortran: 6,634; sh: 3,369; sed: 497; pascal: 188; makefile: 15
file content (145 lines) | stat: -rw-r--r-- 4,022 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#-----------------------------------------------------------------------------
# GNU makefile for WCSLIB 7.4 utilities: fitshdr, HPXcvt, wcsgrid and wcsware.
#
# Summary of the main targets
# ---------------------------
#   build:     Build all utilities.
#   clean (or cleaner): Delete intermediate object files.
#   distclean (or realclean): cleaner, and also delete the executables.
#   cleanest: distclean, and also delete the man pages.
#
# Notes:
#   1: If you need to make changes then preferably modify ../makedefs.in
#      instead and re-run configure.
#
#   2: In compiling these utilities, this makefile assumes that the WCSLIB 7.4
#      sources reside in ../{pgsbox,C} (as in the distribution kit).
#
# Author: Mark Calabretta, Australia Telescope National Facility, CSIRO.
# http://www.atnf.csiro.au/people/Mark.Calabretta
# $Id: GNUmakefile,v 7.4 2021/01/31 02:24:52 mcalabre Exp $
#-----------------------------------------------------------------------------
# Get configure settings.
SUBDIR := utils
include ../makedefs

UTILS := fitshdr

ifneq "$(CFITSIOINC)" ""
ifneq "$(CFITSIOLIB)" ""
  UTILS += HPXcvt wcsware

  ifneq "$(PGPLOTINC)" ""
  ifneq "$(PGPLOTLIB)" ""
    UTILS += wcsgrid
  endif
  endif
endif
endif

MAN := $(addsuffix .1,$(UTILS))

ifneq "$(GETWCSTAB)" ""
  GETWCSTAB := ../C/$(GETWCSTAB)
endif

CPPFLAGS += -I.. -I../C

vpath %.h  ..:../C:../pgsbox
vpath %.in ..


# Static and static pattern rules
#--------------------------------

.PHONY : build clean cleaner cleanest distclean install man realclean

build : $(UTILS)

fitshdr : fitshdr.c
	-@ echo ''
	   $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@.o $<
	   $(LD) -o $@ $@.o $(LDFLAGS) $(LIBS)
	-@ $(RM) $@.o

HPXcvt : HPXcvt.c
	-@ echo ''
	   $(CC) $(CPPFLAGS) $(CFITSIOINC) $(CFLAGS) -c -o $@.o $<
	   $(LD) -o $@ $@.o $(LDFLAGS) $(CFITSIOLIB) $(LIBS)
	-@ $(RM) $@.o

wcsware : wcsware.c $(GETWCSTAB) ../C/$(WCSLIB)
	-@ echo ''
	   $(CC) -DDO_CFITSIO $(CPPFLAGS) -I../pgsbox -I../C $(CFITSIOINC) \
	     $(CFLAGS) -c -o $@.o $<
	   $(LD) -o $@ $@.o $(GETWCSTAB) $(LDFLAGS) $(CFITSIOLIB) -L../C -lwcs \
	     $(LIBS)
	-@ $(RM) $@.o

wcsgrid : wcsgrid.c $(GETWCSTAB) ../pgsbox/libpgsbox-$(LIBVER).a ../C/$(WCSLIB)
	-@ echo ''
	   $(CC) -DDO_CFITSIO $(CPPFLAGS) -I../pgsbox -I../C $(PGPLOTINC) \
	     $(CFITSIOINC) $(CFLAGS) -c -o $@.o $<
	   $(LD) -o $@ $@.o $(GETWCSTAB) $(LDFLAGS) -L../pgsbox -lpgsbox \
	     $(CPGPLOTLIB) $(CFITSIOLIB) -L../C -lwcs $(LIBS)
	-@ $(RM) $@.o

../C/getwcstab.o :
	   $(MAKE) -C ../C $(@F)

clean cleaner :
	-  $(RM) -r *.o *.i a.out core *.dSYM $(EXTRA_CLEAN)

distclean realclean : cleaner
	-  $(RM) $(UTILS)

cleanest : distclean
	-  $(RM) $(MAN)

$(PGSBOXLIB) :
	-@ echo ''
	   $(MAKE) -C ../pgsbox lib

../C/$(WCSLIB) :
	-@ echo ''
	   $(MAKE) -C ../C lib

install : build
	-  if [ ! -d "$(BINDIR)" ] ; then \
	     $(INSTALL) -d -m 775 $(BINDIR) ; \
	   fi
	   $(INSTALL) -m 755 $(UTILS) $(BINDIR)
	-  if [ ! -d "$(MANDIR)" ] ; then \
	     $(INSTALL) -d -m 775 $(MANDIR)/man1 ; \
	   fi
	   $(INSTALL) -m 644 $(MAN) $(MANDIR)/man1

GNUmakefile : ../makedefs ;

../makedefs ../wcsconfig.h ../wcsconfig_utils.h : makedefs.in wcsconfig.h.in \
    wcsconfig_utils.h.in ../config.status
	-@ $(RM) ../wcsconfig.h ../wcsconfig_utils.h
	   cd .. && ./config.status

man : $(MAN)

fitshdr.1 : fitshdr
	help2man --no-discard-stderr --version-string=$(LIBVER) \
	  -n "List headers from a FITS file" -N ./$< > $@

wcsware.1 : wcsware
	help2man --no-discard-stderr --version-string=$(LIBVER) \
	  -n "Extract FITS WCS keywords for an image" -N ./$< > $@

wcsgrid.1 : wcsgrid
	help2man --no-discard-stderr --version-string=$(LIBVER) \
	  -n "Extract FITS WCS keywords and plot graticule" -N ./$< > $@

HPXcvt.1 : HPXcvt
	help2man --no-discard-stderr --version-string=$(LIBVER) \
	  -n "Reorganise HEALPix data into a 2-D FITS image" -N ./$< > $@

# Dependency lists.
fitshdr : wcsconfig.h wcsconfig_utils.h
wcsware : getwcstab.h wcs.h wcsfix.h wcshdr.h
wcsgrid : cpgsbox.h getwcstab.h wcs.h wcsfix.h wcshdr.h