Files
secondo/Algebras/MTopRel/makefile
2026-01-23 17:03:45 +08:00

112 lines
3.0 KiB
Makefile

########################################################################
#
# SECONDO makefile for MTopRel
#
########################################################################
CURRENT_ALGEBRA := MTopRelAlgebra
ALGEBRA_DEPENDENCIES := StandardAlgebra
ALGEBRA_DEPENDENCIES += RelationAlgebra
ALGEBRA_DEPENDENCIES += FunctionAlgebra
ALGEBRA_DEPENDENCIES += TopRelAlgebra
ALGEBRA_DEPENDENCIES += FTextAlgebra
# 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 = TopRelAlgebra
# Use the mace CCFLAGS to add special compiler flags if needed.
# In this case the defaults are sufficient
CCFLAGS = $(DEFAULTCCFLAGS)
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: check_dependencies $(OBJECTS) $(LIBOBJ)
check_dependencies:
$(check-algebra-dependencies)
NFATest: NFATest.o Scanner.o RegExParser.o ../FText/Functions.o
$(CC) -o NFATest NFATest.o RegExParser.o Scanner.o ../FText/Functions.o -lstdc++ -lfl
NFATest.o: NFATest.cpp
$(CC) -fPIC -c -o NFATest.o -I../FText NFATest.cpp
../FText/Functions.o: ../FText/Functions.h ../FText/Functions.cpp
$(MAKE) -C ../FText
OBJECTS += Scanner.o RegExParser.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)
ifeq ($(shared),yes)
# ... as shared object
$(LD) $(LDFLAGS) -o $(LIBOBJ) $(LDOPT) $(OBJECTS) -L$(LIBDIR) -lStandardAlgebra $(SDBLIB) $(TOOLLIB) $(DEFAULTLIB)
else
# ... as static library
$(AR) -r $(LIBOBJ) $(OBJECTS)
endif
RegExParser.o: RegExParser.y.c
$(CC) -fPIC -x c++ -I../FText -c -o RegExParser.o RegExParser.y.c
RegExParser.y.c: RegExParser.y ../FText/Nfa.h
$(YACC) -d -o RegExParser.y.c RegExParser.y
Scanner.o: Scanner.c
$(CC) -fPIC -c -o Scanner.o Scanner.c
Scanner.c: Scanner.l RegExParser.y.c
$(LEX) -o Scanner.c Scanner.l
# remove all generated stuff
.PHONY: clean
clean:
$(RM) $(DEP_FILES) $(OBJECTS) $(LIBOBJ)
$(RM) -f P RegExParser.o RegExParser.y.c Scanner.o Scanner.c NFATest
$(RM) -f RegExParser.y.h
$(RM) -f MTopRelAlgebra.cpp.aux MTopRelAlgebra.cpp.dvi MTopRelAlgebra.cpp.log MTopRelAlgebra.cpp.tex