#dis   
#dis    Open Source License/Disclaimer, Forecast Systems Laboratory
#dis    NOAA/OAR/FSL, 325 Broadway Boulder, CO 80305
#dis    
#dis    This software is distributed under the Open Source Definition,
#dis    which may be found at http://www.opensource.org/osd.html.
#dis    
#dis    In particular, redistribution and use in source and binary forms,
#dis    with or without modification, are permitted provided that the
#dis    following conditions are met:
#dis    
#dis    - Redistributions of source code must retain this notice, this
#dis    list of conditions and the following disclaimer.
#dis    
#dis    - Redistributions in binary form must provide access to this
#dis    notice, this list of conditions and the following disclaimer, and
#dis    the underlying source code.
#dis    
#dis    - All modifications to this software must be clearly documented,
#dis    and are solely the responsibility of the agent making the
#dis    modifications.
#dis    
#dis    - If significant modifications or enhancements are made to this
#dis    software, the FSL Software Policy Manager
#dis    (softwaremgr@fsl.noaa.gov) should be notified.
#dis    
#dis    THIS SOFTWARE AND ITS DOCUMENTATION ARE IN THE PUBLIC DOMAIN
#dis    AND ARE FURNISHED "AS IS."  THE AUTHORS, THE UNITED STATES
#dis    GOVERNMENT, ITS INSTRUMENTALITIES, OFFICERS, EMPLOYEES, AND
#dis    AGENTS MAKE NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE USEFULNESS
#dis    OF THE SOFTWARE AND DOCUMENTATION FOR ANY PURPOSE.  THEY ASSUME
#dis    NO RESPONSIBILITY (1) FOR THE USE OF THE SOFTWARE AND
#dis    DOCUMENTATION; OR (2) TO PROVIDE TECHNICAL SUPPORT TO USERS.
#dis   

SRCROOT=../..

include $(SRCROOT)/src/include/makefile.inc

RM=rm -f 

.SUFFIXES:              .f .o .c .F

LIB=liblaps.a
DEBUGLIB=libdebuglaps.a
ARCHIVE = $(AR) rv

.F.o:
			$(RM) $@  
			$(FC) -c $(FFLAGS) $(INC) $*.F  
			$(ARCHIVE) $(LIB) $(<:.F=.o)
.f.o:
			$(RM) $@
			$(FC) -c $(FFLAGS) $(INC) $*.f
			$(ARCHIVE) $(LIB) $(<:.f=.o)

.c.o:
			$(RM) $@
			$(CC) -c $(CFLAGS) $(INC) $*.c
			$(ARCHIVE) $(LIB) $(<:.c=.o)

BIGFSRC = machine_dependent.F

FSRC=     constant.f \
          cv_i4tim_asc_lp.f \
          cv_asc_i4time.f \
          downcase.f \
          fflxc.f \
          fname_conversions.f \
          filter_2dx.f \
          filter_filenames.f \
          get_dir_length.f \
          get_directory.f \
          get_domain_perimeter.f \
          get_file_names.f \
          get_systime.f \
          get_wrfsi_config.f \
          gridconv.f \
          i4time_fname_lp.f \
          i4time_asc_gg.f \
          lapsgrid.f \
          latlon_to_rlaps.f \
          make_fnam_lp.f \
          map_proj.f \
          move.f \
          rd_laps_static.f \
          read_wrfsi_nl.f \
          timer_fnc.f \
          wfo_fname_conversions.f \
          wrt_laps_static.f \
          ncepsnow.f \
          ztopsa.f \
          \
          get_heights_hydrostatic.f \
          conversions.f \
          esice.f \
          esat.f \
          eslo.f \
          make_td.f \
          rootfind.f \
          ssh2.f


CSRC=     cio.c \
          fort2c_str.c \
          getfilenames_c.c \
          i4time_now_gg.c \
          rwl_v3.c \
          static_routines.c
  

FOBJS=$(FSRC:.f=.o)
BIGFOBJS=$(BIGFSRC:.F=.o)
COBJS=$(CSRC:.c=.o)

all:			lib

lib:			$(LIB)

$(LIB):			$(COBJS) $(BIGFOBJS) $(FOBJS)
			$(RANLIB) $(LIB)
			$(RM) $(FOBJS) $(BIGFOBJS) $(COBJS)

debug:
			$(MAKE) lib LIB='$(DEBUGLIB)' \
			CFLAGS='$(DBCFLAGS)' FFLAGS='$(DBFLAGS)'

clean:
			$(RM) $(FOBJS) $(BIGFOBJS) $(COBJS) core *.a *.mod
