###########################################################################
#
# Makefile system for GILDAS softwares (2003-2023).
#
# Please be careful: element order often matters in makefiles.
#
###########################################################################

include $(gagadmdir)/Makefile.def

###########################################################################

LIB_IDENTITY = mapping

LIB_C_OBJECTS = mapping-sicimport.o

# Creates pymapping.so (implicit compilation of mapping-pyimport.c)
IMPORT_FROM_PYTHON = yes

# List of source codes that are declared obsolete (put in the obsolete
# directory for the moment).
OBSOLETE_CODE = command-uv-restore.o 

INTERFACE_OBJECTS = mapping-interfaces.o mapping-interfaces-private.o	\
mapping-interfaces-public.o

TYPE_OBJECTS = type-mapping-default.o

TOOL_OBJECTS = tool-gaussian.o tool-uv-buffer.o

ADM_COMMAND_OBJECTS = command-dump.o command-flux-scale.o command-load.o	\
command-mosaic.o command-primary.o command-read.o command-show-or-view.o	\
command-specify.o command-statistics.o command-support.o command-write.o

UV_COMMAND_OBJECTS = command-uv-baseline.o command-uv-check.o			\
command-uv-continuum.o command-uv-extract.o command-uv-filter.o			\
command-uv-flag.o command-uv-resample.o command-uv-reweight.o			\
command-uv-rms.o command-uv-shift.o command-uv-sort.o command-uv-stack.o	\
command-uv-statistics.o command-uv-time.o command-uv-truncate.o			\
command-uv-stokes.o

IMAGING_COMMAND_OBJECTS = command-imaging-fit.o command-uv-map.o	\
command-uv-residual.o command-uv-restore.o

CLEAN_COMMAND_OBJECTS = command-clean-clark.o command-clean-clean.o	\
command-clean-hogbom.o command-clean-mfs.o command-clean-mrc.o		\
command-clean-multi.o command-clean-mx.o command-clean-sdi.o

PACKAGE_OBJECTS = language.o message.o package.o 

LIB_F_OBJECTS = $(INTERFACE_OBJECTS) $(TYPE_OBJECTS) $(TOOL_OBJECTS)		\
allocation.o all_clean.o alma_clean.o beam.o clean_arrays.o clean_def.o		\
deconv.o define.o dofft_q.o dofft_v.o dofft_y.o independent.o			\
major_cycle.o major_multi.o many_beams.o map_resample.o map_uv.o minmax.o	\
mosaic.o mx_clean.o mx_cycle.o one_beam.o sort_uv.o sub_alma_4.o		\
sub_alma_bis.o sub_alma.o sub_alma_ter.o sub_convolve.o sub_expand.o		\
sub_major.o sub_mrc.o util_clean.o util_cl.o util_extrema.o util_fit.o		\
util_grid.o utilities.o util_mask.o util_mosaic.o util_multi.o			\
util_noplot.o util_plot.o util_self.o util_sort.o util_stat.o util_uv.o		\
util_weight.o uv-spectral-tools.o weightmode.o where.o				\
$(ADM_COMMAND_OBJECTS) $(UV_COMMAND_OBJECTS) $(IMAGING_COMMAND_OBJECTS)		\
$(CLEAN_COMMAND_OBJECTS) $(PACKAGE_OBJECTS)

LIB_EXPORTS = clean_def.mod clean_arrays.mod mapping_interfaces.mod	\
mapping_interfaces_public.mod mapping_interfaces_private.mod		\
mapping_gaussian_tool.mod mapping_primary.mod mapping_read.mod		\
uv_shift.mod uv_sort_bis.mod

LIB_DEPENDS = $(GREG_LIBS)

# map/lib does not support mandatory-only interfaces
GAG_INTERFACES_MANDATORY = no

ifeq ($(GAG_COMPILER_FKIND),gfortran)
  ifeq ($(GAG_COMPILER_FVERSION_GE_10),yes)
    LOCAL_FFLAGS = -fallow-argument-mismatch
  endif
endif

###########################################################################

include $(gagadmdir)/Makefile.lib

###########################################################################

include $(builddir)/Makefile.deps

###########################################################################
