# *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
# ** Copyright UCAR (c) 1992 - 2013
# ** University Corporation for Atmospheric Research (UCAR)
# ** National Center for Atmospheric Research (NCAR)
# ** Research Applications Lab (RAL)
# ** P.O.Box 3000, Boulder, Colorado, 80307-3000, USA
# *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*

########################################################################
#
# Makefile for the vx_config library
#
########################################################################


EXECUTABLES = 


OBJECTS     = configobjecttype_to_string.o \
              grdfiletype_to_string.o \
              dictionary.o \
              config.tab.o \
              lex.config.o \
              config_file.o \
              config_util.o \


LIBRARIES   = libvx_config.a


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


HEADERS     = config_file.h \
              configobjecttype_to_string.h \
              grdfiletype_to_string.h \
              data_file_type.h \
              config.tab.h \
              dictionary.h \
              object_types.h \
              scanner_stuff.h \
              config_util.h \
              config_constants.h \
              vx_config.h \


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


all: $(OBJECTS) $(LIBRARIES) $(EXECUTABLES)
	@ echo
	@ echo "*** Finished Making the vx_config Library ***"
	@ echo


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


   ##
   ##  objects
   ##


configobjecttype_to_string.o: configobjecttype_to_string.h configobjecttype_to_string.cc
	$(CXX) configobjecttype_to_string.cc -c $(CXX_FLAGS) -I$(MET_INC_DIR)


grdfiletype_to_string.o: grdfiletype_to_string.h grdfiletype_to_string.cc
	$(CXX) grdfiletype_to_string.cc $(CXX_FLAGS) -c -I$(MET_INC_DIR)


dictionary.o: dictionary.h dictionary.cc configobjecttype_to_string.o
	$(CXX) dictionary.cc -c $(CXX_FLAGS) -I$(MET_INC_DIR)


config.tab.o: config.tab.cc
	$(CXX) config.tab.cc -c $(CXX_FLAGS) -I$(MET_INC_DIR)


lex.config.o: lex.config.cc
	$(CXX) lex.config.cc -c -g -I$(MET_INC_DIR)


config_file.o: config_file.h config_file.cc configobjecttype_to_string.o dictionary.o config.tab.o lex.config.o
	$(CXX) config_file.cc -c -g -I$(MET_INC_DIR)


config_util.o: config_util.h config_util.cc
	$(CXX) config_util.cc -c -g -I$(MET_INC_DIR)


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


   ##
   ##  libraries
   ##


libvx_config.a: $(OBJECTS)
	ar -rs libvx_config.a $(OBJECTS) 2>&1
	ranlib libvx_config.a
	rm -f $(MET_LIB_DIR)/libvx_config.a
	cp libvx_config.a $(MET_LIB_DIR)
	cd $(MET_INC_DIR) ; rm -f $(HEADERS)
	cp $(HEADERS) $(MET_INC_DIR)


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


   ##
   ##  executables
   ##



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


clean:
	@ echo
	rm -f *.a *.o temp junk core log a.out out out2 $(OBJECTS) $(LIBRARIES) $(EXECUTABLES)
	rm -f config.output
	rm -f $(MET_LIB_DIR)/libvx_config.a
	cd $(MET_INC_DIR) ; rm -f $(HEADERS)


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


.PHONY: all clean gen_sources


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

