## ## ## $Id$ ##----------------------------------------------------------------------- ## ## (c) Copyright 2009 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: Lance Deaver ## ## Date: Thu Sep 17 17:32:04 EDT 2009 ## ##----------------------------------------------------------------------- ## ## Modification History: ## ## $Log$ ## ##----------------------------------------------------------------------- ## ##----------------------------------------------------------------------- ## Include Files: ##----------------------------------------------------------------------- ## ## ##----------------------------------------------------------------------- ## Defines and Macros: ##----------------------------------------------------------------------- ## MAJOR = 0 MINOR = 2 PATCH = 0 VERSION = $(MAJOR).$(MINOR).$(PATCH) CC = gcc CPP = g++ HOST = 'hostname' LIBDIR = ../../lib INCDIR = ../../include LFLAGS = -+ OPTIONS = -g -Wall -Wextra INCLUDES = -I./ -I../../include LINCLUDES = -L./ -L../../lib -L/usr/lib/ LDFLAGS = -lgrace_np -lgslcblas -lgsl -lConfig -lEvent #DEFINES = -DDEBUG=1 CFLAGS = $(OPTIONS) $(DEFINES) $(INCLUDES) PROG = FOVcorrection MAIN = FOVcorrection.cpp CPPFLAGS = $(CFLAGS) ## ##----------------------------------------------------------------------- ## Objects: ##----------------------------------------------------------------------- ## LIB = libFOVcorrection.$(VERSION).a LIBMAJ = libFOVcorrection.a SHLIB = libFOVcorrection.so.$(VERSION) SHLIBMAJ = libFOVcorrection.so.$(MAJOR) INCFILE = FOVcorrection.h OBJS = $(LIB)(FOVcorrection.o) \ $(LIB)(liner.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) clean: rm $(PROG) $(LIB) $(LIBMAJ) *.o *~ install: cp $(LIB) $(LIBDIR)/$(LIB) cp $(INCFILE) $(INCDIR)/ cd $(LIBDIR); ln -sf $(LIB) $(LIBMAJ) all: $(PROG) .SUFFIXES: .o .c .cpp .cc .c.o: $(CC) $(DEBUG) $(CFLAGS) -c $(INCLUDES) $< .cc.o: $(CPP) $(DEBUG) $(CFLAGS) -c $(INCLUDES) $< .cpp.o: $(CPP) $(DEBUG) $(CFLAGS) -c $(INCLUDES) $<