87 lines
3.0 KiB
Makefile
87 lines
3.0 KiB
Makefile
|
|
#This file is part of SECONDO.
|
||
|
|
|
||
|
|
#Copyright (C) 2004, University in Hagen, Department of Computer Science,
|
||
|
|
#Database Systems for New Applications.
|
||
|
|
|
||
|
|
#SECONDO is free software; you can redistribute it and/or modify
|
||
|
|
#it under the terms of the GNU General Public License as published by
|
||
|
|
#the Free Software Foundation; either version 2 of the License, or
|
||
|
|
#(at your option) any later version.
|
||
|
|
|
||
|
|
#SECONDO is distributed in the hope that it will be useful,
|
||
|
|
#but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
|
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
|
#GNU General Public License for more details.
|
||
|
|
|
||
|
|
#You should have received a copy of the GNU General Public License
|
||
|
|
#along with SECONDO; if not, write to the Free Software
|
||
|
|
#Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||
|
|
|
||
|
|
########################################################################
|
||
|
|
#
|
||
|
|
# SECONDO makefile for Web Algebra C++
|
||
|
|
#
|
||
|
|
########################################################################
|
||
|
|
|
||
|
|
# 30.11.2004, M. Spiekermann. Reorganization of the makefiles at the algbra
|
||
|
|
# level. This is a documented makefile which should explain the
|
||
|
|
# basic structure.
|
||
|
|
|
||
|
|
# include global definitions
|
||
|
|
include ../../makefile.env
|
||
|
|
|
||
|
|
# This is the only macro which must be changed in order to
|
||
|
|
# define a module name for an algebra. The rest of this makefile
|
||
|
|
# should work for nearly every algebra.
|
||
|
|
MODNAME = WEBAlgebra
|
||
|
|
|
||
|
|
# Use the mace CCFLAGS to add special compiler flags if needed.
|
||
|
|
# In this case the defaults are sufficient
|
||
|
|
CCFLAGS = $(DEFAULTCCFLAGS)
|
||
|
|
|
||
|
|
# expand compile flags if necessary
|
||
|
|
CCFLAGS +=
|
||
|
|
|
||
|
|
# The next rule will create a ".o" file for every ".cpp" file and
|
||
|
|
# creates a "lib$(MODNAME).a" file in the secondo/lib dir. Rules
|
||
|
|
# for creating ".dep" files and ".o" files are defined in makefile.env
|
||
|
|
.PHONY: all
|
||
|
|
all: $(OBJECTS) $(LIBOBJ)
|
||
|
|
|
||
|
|
WebFlex.cc: web.l web.h
|
||
|
|
$(LEX) -+ -oWebFlex.cc web.l
|
||
|
|
|
||
|
|
WebFlex.o: WebFlex.cc
|
||
|
|
$(CC) -c WebFlex.cc -o WebFlex.o
|
||
|
|
|
||
|
|
# DEP_FILES is a macro defined in makefile.env. It will contain
|
||
|
|
# a list of files which are generated by the compiler to
|
||
|
|
# detect dependencies to other code files.
|
||
|
|
ifneq ($(MAKECMDGOALS),clean)
|
||
|
|
-include $(DEP_FILES)
|
||
|
|
endif
|
||
|
|
|
||
|
|
.PHONY: deps
|
||
|
|
deps: $(DEP_FILES)
|
||
|
|
|
||
|
|
# The rule below creates a library file. Maybe as shared or as static
|
||
|
|
# object. In case of a shared object all dependencies to other libraries
|
||
|
|
# must be defined. However, currently the command make shared=yes will
|
||
|
|
# not work. But in principle every algebra implementor has to define dependencies
|
||
|
|
# to other libraries here, since the make procedure does not know how to do this
|
||
|
|
# automatically.
|
||
|
|
$(LIBOBJ): $(OBJECTS) WebFlex.o
|
||
|
|
ifeq ($(shared),yes)
|
||
|
|
# ... as shared object
|
||
|
|
$(LD) $(LDFLAGS) -o $(LIBOBJ) $(LDOPT) $(OBJECTS) WebFlex.o -L$(LIBDIR) -lStandardAlgebra $(SDBLIB) $(TOOLLIB) $(DEFAULTLIB)
|
||
|
|
else
|
||
|
|
# ... as static library
|
||
|
|
$(AR) -r $(LIBOBJ) $(OBJECTS) WebFlex.o
|
||
|
|
endif
|
||
|
|
|
||
|
|
# remove all generated stuff
|
||
|
|
.PHONY: clean
|
||
|
|
clean:
|
||
|
|
$(RM) $(DEP_FILES) $(OBJECTS) $(LIBOBJ)
|
||
|
|
$(RM) WebFlex.o WebFlex.cc
|