https://github.com/teuben/nemo
Raw File
Tip revision: d0f673bdaeabe8dffa77528c13d81063a20d29f6 authored by Peter Teuben on 03 April 2024, 01:39:10 UTC
format
Tip revision: d0f673b
makedefs.in
# -*- makefile -*-

#  this file should get included by each Makefile in NEMO 

#  ONLY EDIT THIS FILE IF IT'S $NEMOLIB/makedefs
#    diff $NEMO/makedefs $NEMOLIB
#  ((the one in $NEMO is the configure generated one that gets copied))
#  ((to $NEMOLIB via the "make config_extra" command during the))
#  (("make build1" step of the install))

#  Note that the falcON tools (e.g. gyrfalcON) do not use this file.
#  See the $NEMO/usr/dehnen/utils/make.* files to figure out how
#  to tune these tools. Walter did a pretty darn good job, see if you
#  beat that!

#  DSO linking: might need to wrap offending libraries 
#       -Wl,--no-as-needed -lX11 -Wl,-as-needed
#  instead of 
#                          -lX11
#  Another option is to add -Wl,--no-as-needed to CFLAGS
#  This is the current default in configure (to use it)
#  Comment the next line if you do not want this, or use --without-dso
NEMO_CFLAGS1 = @DSO_LINK@


# handy for recursion
@SET_MAKE@

# Compilers:

CC  = @CC@
FC  = @F77@
F77 = @F77@
CXX = @CXX@

# HDF4 library
#HDF_INC=-I/local/include -I/usr/local/include -I/usr/include/hdf
#HDF_LIB=-ldf -ljpeg -lz -lsz
HDF_INC = @HDF_INC@
HDF_LIB = @HDF_LIB@

#  HDF5 library:  -lhdf5
# --with-hdf5-incdir=   --with-hdf5-libdir=
#HDF5_INC = `pkg-config --cflags hdf5`
#HDF5_LIB = `pkg-config --libs hdf5`
HDF5_INC = @HDF5_INC@
HDF5_LIB = @HDF5_LIB@

#  PNG library
#PNG_LIB = `pkg-config --libs libpng`
PNG_LIB = @PNG_LIB@

#  CFITSIO library: -lcfitsio -lcurl -lz -lbz2
#CFITSIO_INC = `pkg-config --cflags cfitsio`
#CFITSIO_LIB = `pkg-config --libs cfitsio`
CFITSIO_INC = @CFITSIO_INC@
CFITSIO_LIB = @CFITSIO_LIB@

#  NETCDF4 library: -lnetcdf
#NETCDF_INC = `pkg-config --cflags netcdf`
#NETCDF_LIB = `pkg-config --libs netcdf`
NETCDF_INC = @NETCDF_INC@
NETCDF_LIB = @NETCDF_LIB@

#  MIRIAD library
MIRIAD_INC = @MIRIAD_INC@
MIRIAD_LIB = @MIRIAD_LIB@

#  GSL library:   -lgsl -lgslcblas -lm
#GSL_INC = @GSL_CFLAGS@
#GSL_LIB = @GSL_LIBS@
GSL_INC = 
GSL_LIB =

#	PLPLOT: -lplplot
#PLPLOT_INC = -I/usr/include/plplot
#PLPLOT_LIB = -lplplot
PLPLOT_INC = @PLPLOT_CFLAGS@
PLPLOT_LIB = @PLPLOT_LIBS@

#	FFTW
#       -lfftw3, or -lfftw3f or -lfftw3l (depending on precision library, for float or long double)
#       [actually still not used yet]
#FFTW_CFLAGS = @FFTW_CFLAGS@
#FFTW_LIBS   = @FFTW_LIBS@
FFTW_INC = 
FFTW_LIB =


#	READLINE
RDL_LIBS   = @RDL_LIBS@

# LOADOBJ stuff; -DMACH=.....

MACH = @LOADOBJ_MACH@


# 	Fortran: you need FLIBS if you link using 'cc' and link 
#	with (certain) fortran. See also F77_FUNC macros (config.h)
#	if you need to use fortran names from your C code, or if you
#	need to define C code that is to be called from Fortran

#       F77_CMAIN_FFLAGS is needed if you link with fortran, but main is in C
#  on older MacOS you need to remove any -lcrt1.o and -lcrt2.o (or the like) references
FLIBS = @FLIBS@
FORLIBS = $(FLIBS)
F77_CMAIN_FFLAGS = @F77_CMAIN_FFLAGS@

# YAPPLIB: was removed from NEMORC.{gen,local}
# sometimes (for native cc/f77 compiler on solaris) you need to append $(FLIBS) here
# since FLIBS isn't computed properly
# Note for some PGPLOT devices (e.g. PNDRIV) you will need to add -lpng)
# for PLPLOT a choice between -lplplotd and -lplplotf needs to be consistent with
#  the definition triggered for pl_real in yapp_plplot.c !! this is not automated yet
#  via configure.
YAPPLIB = $(NEMOLIB)/yapp_@YAPP_NAME@.o @YAPP_LIBS@

## C compiler:
#set opts="-rdynamic -ansi -fwritable-strings -Wconversion -Wnested-externs"
#exec gcc -fPIC -Dlinux -DSYSV -I$NEMOINC -I$NEMOLIB -L$NEMOLIB $opts $* $link
## Fortran compiler
#  some older gnu compilers may still need -fno-globals

INC_FLAGS = -I$(NEMOINC) -I$(NEMOLIB) -I$(NEMO)/opt/include @HDF_INC@ @HDF5_INC@ @XINCS@

NEMO_CFLAGS = @NEMO_CFLAGS@  $(MACH) $(NEMO_CFLAGS1) $(INC_FLAGS)
NEMO_FFLAGS = @NEMO_FFLAGS@  $(INC_FLAGS)
NEMO_LDFLAGS = 
NEMO_LIBS   = -L$(NEMOLIB) -L$(NEMO)/opt/lib          -lnemo @LOADOBJ_LIBS@ $(GSL_LIBS) $(RDL_LIBS) $(CFITSIO_LIB) @MATH_LIBS@ @MACOS_LIBS@
NEMO_LIBSPP = -L$(NEMOLIB) -L$(NEMO)/opt/lib -lnemo++ -lnemo @LOADOBJ_LIBS@ $(GSL_LIBS) $(RDL_LIBS) $(CFITSIO_LIB) @MATH_LIBS@ @MACOS_LIBS@

#			some graphics libraries:
GLLIBS = @GLLIBS@
XLIBS  = @XLIBS@

#			generic compile flags for C,Fortran,Linker
# If you must absolutely be pedantic, the following gnu compiler flags are the recommended ones
# (see GSL users guide - appendix A)
# PEDFLAG="-ansi -pedantic -Werror -Wall -W -Wmissing-prototypes -Wstrict-prototypes -Wtraditional -Wconversion -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align  -Wwrite-strings -Wnested-externs  -fshort-enums -fno-common -Dinline= -g -O4"
#   optimization only
#PEFFLAG = -Werror-implicit-function-declaration -Wimplicit-int -Wimplicit-function-declaration
#PEDFLAG = --warn-no-implicit-function-declaration
#PEDFLAG = -Wimplicit-int -Wimplicit-function-declaration
#PEDFLAG = -Wno-error      # if you want the compiler to shut up and just take a chance in life
PFLAGS = @PFLAGS@ -Wimplicit-function-declaration
COPT = @CFLAGS@ 
FOPT = @FFLAGS@
LOPT = @LDFLAGS@
#   for shared libaries
CCSHARED = @CCSHARED@
#   everything 
CFLAGS   = $(COPT) $(CCSHARED) $(NEMO_CFLAGS) $(PFLAGS)  @STDFLAG@
CXXFLAGS = $(COPT) $(CCSHARED) $(NEMO_CFLAGS)
FFLAGS   = $(FOPT) $(CCSHARED) $(NEMO_FFLAGS)
LDFLAGS  = $(LOPT)             $(NEMO_LDFLAGS)
CPPFLAGS = @CPPFLAGS@

RANLIB = @RANLIB@

# -----------------------------------------------------------------------------
#  rules

.SUFFIXES:  .so .doc

#	NEMO compile rules

.o.a:
	@echo "***Skipping ar for $* at this stage"

.c.o:
	$(CC) $(CFLAGS) $(LOCAL_INC) -c $<

.cc.o:
	$(CXX) $(CXXFLAGS) $(LOCAL_INC) -c $<

.c.so:
	$(CC) $(CFLAGS) $(LOCAL_INC) -c $<
	ldso $*

.cc.so:
	$(CXX) $(CXXFLAGS) $(LOCAL_INC) -c $<
	ldso $*

.f.so:
	$(FC) $(FFLAGS) -c $<
	ldso $*

.c.a:
	$(CC) $(CFLAGS) $(LOCAL_INC) -c $<

.c:
	$(CC) $(CFLAGS) $(LOCAL_INC) -o $* $*.c $(NEMO_LIBS) $(LOCAL_LIB) $(FORLIBS) $(EL)

.cc:
	$(CXX) $(CXXFLAGS) $(LOCAL_INC) -o $* $*.c $(NEMO_LIBSPP) $(LOCAL_LIB) $(FORLIBS) $(EL)

.o:
	$(CC) $(CFLAGS) $(LOCAL_INC) -o $* $*.o $(NEMO_LIBS) $(LOCAL_LIB) $(FORLIBS) $(EL)


# -----------------------------------------------------------------------------


# some fortran code needs a REAL FUNCTIONS SECOND (e.g. scfm)
# this macro should point to the .o file (if needed)
# Sometimes it is FORLIBS, sometimes your etime.o or second.o

# On Solaris you need second.o; Linux can keep it blank (it's in libg2c)
# SECOND = $(NEMOLIB)/second.o

# xxxTYPE's:   falcON now uses      PLATFORM := $(shell uname -m)
PLATFORM := $(shell uname -m)


makedefs_help:
	@echo ========================================================================
	@echo NEMOVER=$(NEMOVER)
	@echo CC=$(CC)
	@echo CFLAGS=$(CFLAGS)
	@echo CPP=$(CPP)
	@echo CPPFLAGS=$(CPPFLAGS)
	@echo CXX=$(CXX)
	@echo CXXFLAGS=$(CXXFLAGS)
	@echo F77=$(F77)
	@echo FFLAGS=$(FFLAGS)
	@echo DEFS=$(DEFS)
	@echo CFLAGS=$(CFLAGS)
	@echo FFLAGS=$(FFLAGS)
	@echo LDFLAGS=$(LDFLAGS)
	@echo FC=$(F77)
	@echo LN_S=$(LN_S)
	@echo GLLIBS=$(GLLIBS)
	@echo XLIBS=$(XLIBS)
	@echo LIBS=@LIBS@
	@echo RANLIB=$(RANLIB)
	@echo YAPPLIB=$(YAPPLIB)
	@echo PLATFORM=$(PLATFORM)
	@echo HOSTTYPE=$(HOSTTYPE)
	@echo MACHTYPE=$(MACHTYPE)
	@echo OSTYPE=$(OSTYPE)
	@echo ========================================================================


# this peculiar include will include a file LocalMakedefs in the local/current
# directory only if it is present, but not complain if not present. This is
# the recommended way to tailor a particular directory, e.g. for debugging
# you could add something like
#      NEMO_CFLAGS += -Wall -W -g
#
-include LocalMakedefs

back to top