## ## ## $Id$ ##----------------------------------------------------------------------- ## ## (c) Copyright 2002 by GATS, Inc., ## 11864 Canon Blvd, Suite 101, Newport News VA 23606 ## ## All Rights Reserved. No part of this software or publication may be ## reproduced, stored in a retrieval system, or transmitted, in any form ## or by any means, electronic, mechanical, photocopying, recording, or ## otherwise without the prior written permission of GATS, Inc. ## ##----------------------------------------------------------------------- ## ## Module: Makefile ## ## Author: John Burton ## ## Date: Wed Sep 25 15:28:00 2002 ## ##----------------------------------------------------------------------- ## ## Modification History: ## ## $Log$ ## ##----------------------------------------------------------------------- ## ##----------------------------------------------------------------------- ## Include Files: ##----------------------------------------------------------------------- ## ## ##----------------------------------------------------------------------- ## Defines and Macros: ##----------------------------------------------------------------------- ## MAJOR = 2 MINOR = 1 PATCH = 0 VERSION = $(MAJOR).$(MINOR).$(PATCH) FC = gfortran CC = gcc CPP = g++ HOST = 'hostname' LIBDIR = ../../lib INCDIR = ../../include LFLAGS = -+ #OPTIONS = -g -Wall OPTIONS = -O3 INCLUDES = -I./ -I $(INCDIR) -I/usr/include/netcdf-3 LINCLUDES = -L./ -L /usr/lib/mysql LDFLAGS = -lEvent -lCMarkup -lConfig -lGATS_Exception -lLinepak -lGATS_DB -lgfortran -lmysqlclient -lnetcdf -lgrace_np #DEFINES = -DDEBUG=1 CFLAGS = $(OPTIONS) $(DEFINES) $(INCLUDES) PROG = TestCO2ProfileSimulation MAIN = main.cpp CPPFLAGS = $(CFLAGS) FFLAGS = $(OPTIONS) -fsecond-underscore ## ##----------------------------------------------------------------------- ## Objects: ##----------------------------------------------------------------------- ## LIB = libCO2ProfileSimulation.$(VERSION).a LIBMAJ = libCO2ProfileSimulation.a SHLIB = libCO2ProfileSimulation.so.$(VERSION) SHLIBMAJ = libCO2ProfileSimulation.so.$(MAJOR) INCFILE = CO2ProfileSimulation.h F77Radtran.h F77Functions.h FORTRANarray.hpp OBJS = $(LIB)(CO2ProfileSimulation_bp.o) \ $(LIB)(read_waccm_interp.o) \ $(LIB)(closefile.o) \ $(LIB)(openfile.o) \ $(LIB)(refraction.o) \ $(LIB)(readfasatm2.o) \ $(LIB)(hydro.o) \ $(LIB)(radgrav.o) \ $(LIB)(waccm_atmstate_interp.o) \ $(LIB)(get_waccmfile_interp.o) # $(LIB)(filterlimits.o) \ # $(LIB)(LoadLinesFromDB.o) \ # $(LIB)(Molecule.o) ## ##----------------------------------------------------------------------- ## Targets: ##----------------------------------------------------------------------- ## # #------------------------------------------------------------------------ # Target for converting a lex or yacc file to C code, then compiling and # adding it to an archive file #------------------------------------------------------------------------ # .l.a: $(LEX) $(LFLAGS) $< mv lex.yy.cc $*.cpp $(CPP) -c $(CFLAGS) -o $*.o $*.cpp $(AR) $(ARFLAGS) $@ $*.o rm -f $*.o # rm -f $*.cpp .y.a: $(YACC) $(YFLAGS) $< mv $*.tab.c $*.c $(CC) -c $(CFLAGS) $*.c $(AR) $(ARFLAGS) $@ $*.o rm -f $*.o rm -f $*.c # #------------------------------------------------------------------------ # Target for creating the main program #------------------------------------------------------------------------ # $(LIB): $(OBJS) $(DEFS) # ar rv $(LIB) $(OBJS) ranlib $(LIB) ln -sf $(LIB) $(LIBMAJ) lib: $(LIB) cp $(LIB) $(LIBDIR)/$(LIB) cp $(INCFILE) $(INCDIR) cd $(LIBDIR); ln -sf $(LIB) $(LIBMAJ) $(PROG): $(LIB) $(MAIN) $(OBJS) $(CPP) $(CFLAGS) -o $@ $(MAIN) $(LIB) $(LINCLUDES) $(LDFLAGS) init: cp $(INCFILE) $(INCDIR) clean: rm $(PROG) $(LIB) $(LIBMAJ) *.o *~ install: cp $(LIB) $(LIBDIR)/$(LIB) cp $(INCFILE) $(INCDIR) cd $(LIBDIR); ln -sf $(LIB) $(LIBMAJ)