#                       Copyright (c) 1995 by
#                       Advanced Visual Systems Inc.
#                       All Rights Reserved
#
#       This software comprises unpublished confidential information of
#       Advanced Visual Systems Inc. and may not be used, copied or made
#       available to anyone, except in accordance with the license
#       under which it is furnished.
#
#       This file is under Perforce control
#       $Id: //depot/express/fcs70/netcdf/Makefile#1 $
#

include ../include/stddefs.mk

LIBFILE=$(XP_LIB_DIR)/libnetcdf.a
DLLIB=$(XP_LIB_DIR)/libnetcdf
LIB_TO_MAKE_DLLIB_FROM=$(LIBFILE)

HFILE=$(XP_INC_DIR)/avs/netcdf.h
AUTOGEN_CONFIG=config.cache

# Don't make shared lib in this dir for now.
# If you want to, the place to start is to add the proper compilation
# flags to compile position-independent on all platforms, and uncomment
# the include of XP_MACHRULE_PATH below.
#default: $(LIBFILE) $(HFILE) $(DLLIBNAME)
default: $(LIBFILE) $(HFILE) subdirs

$(LIBFILE) $(HFILE):
	CFLAGS="$(G) $(CFLAGS)" FFLAGS="$(FFLAGS)" CXXFLAGS="$(CXXFLAGS)" ./configure --prefix=.
	make -f Makefile.uni libsrc/all
	mv -f libsrc/libnetcdf.a $(LIBFILE)
	cp -f -p libsrc/netcdf.h $(HFILE)
	make -f Makefile.uni libsrc/clean

subdirs:
	cd xp_mods; $(MAKE) $(MFLAGS)

clean::
	rm -f $(HFILE) $(LIBFILE) $(DLLIBNAME) $(AUTOGEN_CONFIG)
	rm -f config.status config.log macros.make
	rm -f libsrc/ncconfig.h
	cd xp_mods; $(MAKE) clean

#include $(XP_MACHRULE_PATH)
