Eigenmath/Makefile

136 lines
4.5 KiB
Makefile

as = sh3eb-elf-as
cc = sh3eb-elf-gcc
cxx = sh3eb-elf-g++
objcopy = sh3eb-elf-objcopy
wrapper = g1a-wrapper
flags = -m3 -mb -Os -nostdlib
cflags = $(flags) -std=c11 -W -Wall -Wno-main -pedantic
cxxflags= $(flags) -std=c++11 -W -Wall -Wno-main -pedantic -fno-exceptions
include = -Iinclude/fx -Iinclude
libs = -Llib -lgcc -lc -lfx
name = eigenmath
target-g1a = eigen.g1a
# besselj and bessely and history good bye
file-src = $(addprefix src/, \
crt0.s syscalls.s \
main.cpp config.c memory.c new.cpp\
console/console.cpp console/cursor.cpp console/display.cpp \
console/expr.cpp console/font.cpp console/key.cpp \
console/line.cpp console/node.cpp console/string.cpp \
console/symbol.cpp \
engine/abs.cpp engine/add.cpp engine/adj.cpp \
engine/alloc.cpp engine/append.cpp \
engine/arccos.cpp engine/arccosh.cpp \
engine/arcsin.cpp engine/arcsinh.cpp \
engine/arctan.cpp engine/arctanh.cpp \
engine/arg.cpp engine/atomize.cpp \
engine/bake.cpp \
engine/bignum.cpp \
engine/binomial.cpp engine/ceiling.cpp \
engine/choose.cpp engine/circexp.cpp \
engine/clear.cpp engine/clock.cpp \
engine/coeff.cpp engine/cofactor.cpp \
engine/condense.cpp engine/conj.cpp \
engine/cons.cpp engine/contract.cpp \
engine/cos.cpp engine/cosh.cpp \
engine/data.cpp engine/decomp.cpp \
engine/define.cpp engine/defint.cpp \
engine/degree.cpp engine/denominator.cpp \
engine/denominator.cpp engine/derivative.cpp \
engine/det.cpp engine/dirac.cpp \
engine/display.cpp engine/distill.cpp \
engine/divisors.cpp engine/dpow.cpp \
engine/dsolve.cpp engine/eigen.cpp \
engine/erf.cpp engine/erfc.cpp \
engine/eval.cpp engine/expand.cpp \
engine/expcos.cpp engine/expsin.cpp \
engine/factor.cpp engine/factorial.cpp \
engine/factorpoly.cpp engine/factors.cpp \
engine/factors.cpp engine/filter.cpp \
engine/find.cpp engine/float.cpp \
engine/floor.cpp engine/for.cpp \
engine/gamma.cpp engine/gcd.cpp \
engine/guess.cpp engine/hermite.cpp \
engine/hilbert.cpp \
engine/imag.cpp engine/index.cpp \
engine/index.cpp engine/init.cpp \
engine/inner.cpp engine/integral.cpp \
engine/inv.cpp engine/is.cpp \
engine/isprime.cpp engine/itab.cpp \
engine/itest.cpp engine/laguerre.cpp \
engine/laplace.cpp engine/lcm.cpp \
engine/leading.cpp engine/legendre.cpp \
engine/list.cpp engine/log.cpp \
engine/madd.cpp engine/mag.cpp \
engine/main_engine.cpp engine/mcmp.cpp \
engine/mfactor.cpp engine/mgcd.cpp \
engine/misc.cpp engine/mmodpow.cpp \
engine/mmul.cpp engine/mod.cpp engine/mpow.cpp \
engine/mprime.cpp engine/mroot.cpp \
engine/mscan.cpp engine/msqrt.cpp \
engine/mstr.cpp engine/multiply.cpp \
engine/nroots.cpp engine/numerator.cpp \
engine/outer.cpp engine/partition.cpp \
engine/polar.cpp engine/pollard.cpp \
engine/power.cpp engine/prime.cpp \
engine/primetab.cpp engine/print.cpp \
engine/product.cpp engine/qadd.cpp \
engine/qdiv.cpp engine/qmul.cpp \
engine/qpow.cpp engine/qsub.cpp \
engine/quickfactor.cpp engine/quotient.cpp \
engine/rationalize.cpp engine/real.cpp \
engine/rect.cpp engine/rewrite.cpp \
engine/roots.cpp engine/run.cpp \
engine/scan.cpp engine/sgn.cpp \
engine/simfac.cpp engine/simplify.cpp \
engine/sin.cpp engine/sinh.cpp \
engine/stack.cpp engine/subst.cpp \
engine/sum.cpp engine/symbol.cpp \
engine/tan.cpp engine/tanh.cpp \
engine/taylor.cpp engine/tensor.cpp \
engine/test.cpp engine/transform.cpp \
engine/transpose.cpp engine/userfunc.cpp \
engine/variables.cpp engine/vectorize.cpp \
engine/zero.cpp )
file-obj = $(patsubst src/%,build/%.o,$(file-src))
file-ld = addin.ld
file-icon = icon.bmp
all: build $(target-g1a)
@echo "Tout est au mieux dans le meilleur des mondes : c'est un succès"
build:
mkdir -p $@ $@/tex $@/engine $@/console
$(target-g1a): $(file-obj)
$(cxx) $(flags) $^ -T$(file-ld) -o build/$(name).elf $(libs)
$(objcopy) -R .comment -R .bss -O binary build/$(name).elf build/$(name).bin
g1a-wrapper build/$(name).bin -o $@ $(wrap)
# Generate the set of rules needed
define make-obj-rules
build/$1%.c.o: src/$1%.c $(file-dep)
$(cc) -c $$< -o $$@ $(cflags) $(include)
build/$1%.cpp.o: src/$1%.cpp $(file-dep)
$(cxx) -c $$< -o $$@ $(cxxflags) $(include)
build/$1%.s.o: src/$1%.s $(file-dep)
$(as) -c $$^ -o $$@
endef
$(eval $(call make-obj-rules,))
$(foreach d,$(shell cd src && find -type d),\
$(eval $(call make-obj-rules,$(d)/)))
clean:
@ rm -rf build
mrproper: clean
@ rm -f $(target-g1a)
@ rm -rf build
distclean: mrproper