# Makefile for the Mathomatic symbolic math library and library test program. # Be sure to "make clean" between using different makefiles. CC ?= gcc INSTALL ?= install VERSION = `cat VERSION` CFLAGS += -Wall -Wshadow -Wno-char-subscripts # gcc specific flags; can be removed CFLAGS += -O -DLIBRARY -DVERSION=\"$(VERSION)\" # C compiler flags LDLIBS += -lm # libraries to link prefix ?= /usr/local AOUT = mathomatic # The name of the library test executable file to create. LIB = libmathomatic.a # The name of the symbolic math library file to create. HEADERS = lib/mathomatic.h OBJECTS = lib/lib.o globals.o am.o solve.o help.o parse.o cmds.o simplify.o \ factor.o super.o unfactor.o poly.o diff.o integrate.o \ complex.o complex_lib.o list.o gcd.o factor_int.o all: $(AOUT) lib $(LIB): $(OBJECTS) ar cr $(LIB) $(OBJECTS) ranlib $(LIB) $(OBJECTS): $(HEADERS) includes.h license.h am.h externs.h complex.h proto.h altproto.h VERSION $(AOUT): lib/test.o $(LIB) $(CC) $(LDFLAGS) lib/test.o $(LIB) $(LDLIBS) -o $(AOUT) @echo ./$(AOUT) created. install: $(INSTALL) -m 0644 $(LIB) $(prefix)/lib $(INSTALL) -m 0644 $(HEADERS) $(prefix)/include @echo Mathomatic symbolic math library installed. clean: rm -f *.o rm -f lib/*.o flush: clean rm -f $(AOUT) rm -f *.a */*.a