File: GNUmakefile

package info (click to toggle)
wcslib 7.4+ds-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 (209 lines) | stat: -rw-r--r-- 6,818 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
#-----------------------------------------------------------------------------
# GNU makefile for building WCSLIB 7.4
#
# Summary of the main targets
# ---------------------------
#   all:       Do 'make all' in each subdirectory (excluding ./doxygen).
#   check:     Do 'make check' in each subdirectory (compile and run tests).
#   tests:     Do 'make tests' in each subdirectory (compile test programs but
#              don't run them).
#   install:   Do 'make install' in each subdirectory.
#   clean:     Recursively delete intermediate files produced as part of the
#              build, e.g. object modules, core dumps, etc.
#   cleaner:   Recursively clean, and also delete test executables, test
#              input and output, and intermediates produced in compiling the
#              programmers' manual.
#   distclean (or realclean): Recursively delete all platform-dependent files
#              generated during the build, preserving only the programmers'
#              manual and man pages (which are normally provided pre-built).
#              It is the one to use between builds for multiple platforms.
#   cleanest:  Like distclean, but deletes everything that can be regenerated
#              from the source files, including the programmers' manual and
#              man pages, but excluding 'configure'.
#   show:      Print the values of important variables used in this and the
#              other makefiles.
#   writable:  Run chmod recursively to make all sources writable.
#
# Notes:
#   1) If you need to make changes then preferably modify makedefs.in instead.
#
#   2) Refer also to the makefiles in subdirectories, particularly
#      C/GNUmakefile.
#
# 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 := .
include makedefs

ifeq "$(CHECK)" "nopgplot"
  TSTDIRS := $(filter-out pgsbox,$(TSTDIRS))
endif

.PHONY : build check chmod clean cleaner cleanest distclean install \
         realclean show tests writable

build :
	-@ for DIR in $(SUBDIRS) ; do \
	     echo '' ; \
	     $(TIMER) ; \
	     $(MAKE) -k -C $$DIR build ; \
	   done

check tests :: show
	-@ echo ''
	-@ $(TIMER)
	 @ for DIR in $(SUBDIRS) ; do \
	     echo '' ; \
	     $(MAKE) -i -C $$DIR cleaner build ; \
	   done
	-@ echo ''
	 @ for DIR in $(TSTDIRS) ; do \
	     echo '' ; \
	     $(TIMER) ; \
	     $(MAKE) -k -C $$DIR $@ ; \
	   done

check ::
	-@ echo ''
	-@ echo 'Summary of results for non-graphical tests'
	-@ echo '------------------------------------------'
	-@ cat ./*/test_results
	 @ if grep 'FAIL:' ./C/test_results > /dev/null ; then \
	     exit 1 ; \
	   else \
	     exit 0 ; \
	   fi

install :
	 @ for DIR in $(INSTDIR) ; do \
	     $(MAKE) -k -C $$DIR $@ ; \
	   done
	   $(INSTALL) -m 444 wcsconfig.h wcsconfig_f77.h $(INCDIR)
	-  if [ ! -d "$(DOCDIR)" ] ; then \
	     $(INSTALL) -d -m 775 $(DOCDIR) ; \
	   fi
	   $(INSTALL) -m 444 CHANGES COPYING* README $(DOCDIR)
	-  if [ -h $(DOCLINK) ] ; then \
	     $(RM) $(DOCLINK) ; \
	     $(LN_S) $(notdir $(DOCDIR)) $(DOCLINK) ; \
	   fi
	-  if [ ! -d "$(PDFDIR)" ] ; then \
	     $(INSTALL) -d -m 775 $(PDFDIR) ; \
	   fi
	   $(INSTALL) -m 444 wcslib.pdf $(PDFDIR)
	-  if [ ! -d "$(HTMLDIR)/html" ] ; then \
	     $(INSTALL) -d -m 775 $(HTMLDIR)/html ; \
	   fi
	   $(INSTALL) -m 444 html/* $(HTMLDIR)/html
	   if [ ! -d "$(LIBDIR)/pkgconfig" ] ; then \
	     $(INSTALL) -d -m 775 $(LIBDIR)/pkgconfig ; \
	   fi
	   $(INSTALL) -m 444 wcslib.pc $(LIBDIR)/pkgconfig/wcslib.pc

clean cleaner :
	   for DIR in $(SUBDIRS) doxygen ; do \
	     $(MAKE) -C $$DIR $@ ; \
	   done

cleanest distclean realclean :
	   for DIR in $(SUBDIRS) doxygen ; do \
	     $(MAKE) -C $$DIR $@ ; \
	   done
	-  $(RM) *.log
	-  $(RM) -r autom4te.cache autoscan.log
	-  $(RM) -r api-sanity-check
	-  $(RM) confdefs.h conftest.*
	-  $(RM) config.log config.status configure.lineno
	-  $(RM) makedefs wcslib.pc
	-  $(RM) wcsconfig.h wcsconfig_*.h
	-  $(RM) wcslib-*.tar.gz

show ::
	-@ echo 'Subdirectories to be built...'
	-@ echo '  SUBDIRS     := $(SUBDIRS)'
	-@ echo '  TSTDIRS     := $(TSTDIRS)'
	-@ echo ''

writable :
	  chmod -R u+w .

GNUmakefile : makedefs ;

makedefs : makedefs.in config.status
	-@ echo ''
	-@ $(TIMER)
	   ./config.status

config.status : configure
	-@ echo ''
	-@ $(TIMER)
	-@ echo ''
	-@ echo "Environment variables that affect 'configure':"
	-@ echo "  FLEX     = $${FLEX-(undefined)}"
	-@ echo "  FLFLAGS  = $${FLFLAGS-(undefined)}"
	-@ echo "  CPP      = $${CPP-(undefined)}"
	-@ echo "  CPPFLAGS = $${CPPFLAGS-(undefined)}"
	-@ echo "  CC       = $${CC-(undefined)}"
	-@ echo "  CFLAGS   = $${CFLAGS-(undefined)}"
	-@ echo "  F77      = $${F77-(undefined)}"
	-@ echo "  FFLAGS   = $${FFLAGS-(undefined)}"
	-@ echo "  ARFLAGS  = $${ARFLAGS-(undefined)}"
	-@ echo "  LDFLAGS  = $${LDFLAGS-(undefined)}"
	-@ echo ''
	   ./configure --no-create


#-----------------------------------------------------------------------------
# These are for code management.

.PHONY : dist

dist :
	   $(MAKE) -C doxygen cleanest build
	   $(MAKE) -C utils man
	   $(MAKE) distclean
	-@ echo $(WCSLIBPKG)/C/RCS        >  wcslib.X
	-@ echo $(WCSLIBPKG)/C/flexed/RCS >> wcslib.X
	-@ echo $(WCSLIBPKG)/C/test/RCS   >> wcslib.X
	-@ echo $(WCSLIBPKG)/doxygen/RCS  >> wcslib.X
	-@ echo $(WCSLIBPKG)/Fortran/RCS  >> wcslib.X
	-@ echo $(WCSLIBPKG)/Fortran/test/RCS >> wcslib.X
	-@ echo $(WCSLIBPKG)/makedefs     >> wcslib.X
	-@ echo $(WCSLIBPKG)/other        >> wcslib.X
	-@ echo $(WCSLIBPKG)/pgsbox/RCS   >> wcslib.X
	-@ echo $(WCSLIBPKG)/RCS          >> wcslib.X
	-@ echo $(WCSLIBPKG)/TODO         >> wcslib.X
	-@ echo $(WCSLIBPKG)/utils/RCS    >> wcslib.X
	-@ echo $(WCSLIBPKG)/wcslib.T     >> wcslib.X
	-@ echo $(WCSLIBPKG)/wcslib.X     >> wcslib.X
	   rm -f $(WCSLIBPKG).tar.bz2
	   tar cf - -C .. -X wcslib.X $(WCSLIBPKG) | \
	     tar t | \
	     grep -v '/$$' | \
	     sort > wcslib.T
	   rm -f wcslib.X
	   tar cvf $(WCSLIBPKG).tar -C .. -T wcslib.T
	   rm -f wcslib.T
	   bzip2 $(WCSLIBPKG).tar
	   chmod 444 $(WCSLIBPKG).tar.bz2

install_dist :
	   scp -p $(WCSLIBPKG).tar.bz2 cal103@venice:/nfs/ftp/software/wcslib/
	   mv -f  $(WCSLIBPKG).tar.bz2 ../wcslib-releases/
	   ssh cal103@venice "cd /nfs/ftp/software/wcslib/ && \
	     rm -f wcslib.tar.bz2 && \
	     ln -s $(WCSLIBPKG).tar.bz2 wcslib.tar.bz2"
	   cp -fp CHANGES wcslib.pdf ~/public_html/WCS/
	   rsync --archive --delete html/ ~/public_html/WCS/wcslib/

configure : configure.ac
	-@ echo ''
	-@ $(TIMER)
	   autoconf

# Code development overrides must be included specifically before 'configure'
# generates makedefs.
-include flavours