# ------------------------------------------------------------------------------ # https://dataswamp.org/~incal/peval/Makefile # ------------------------------------------------------------------------------ mkef = -j -s mcmd = $(MAKE) $(mkef) # ----------------------------------------------------------------------------- name = peval incl = include c = $(name).c so = $(name).so el = $(name).el elc = $(name).elc elt = $(name)-test # ----------------------------------------------------------------------------- cc = gcc warn = -Wall -Wextra -pedantic-errors ccfl = -shared -fPIC -std=c99 -Os $(warn) -I $(incl) comp = $(cc) $(ccfl) -s # ----------------------------------------------------------------------------- emfl = --batch -Q -D -nw # ----------------------------------------------------------------------------- all: $(so) $(elc) # ----------------------------------------------------------------------------- $(elc): $(el) emacs $(emfl) -f batch-byte-compile $< 2>&1 > /dev/null emacs $(emfl) -f batch-byte-compile $< emacs $(emfl) -f batch-native-compile $< # ----------------------------------------------------------------------------- $(so): $(c) $(comp) -o $@ $< # ----------------------------------------------------------------------------- clean: rm -f $(so) $(elc) # ----------------------------------------------------------------------------- again: $(mcmd) clean $(mcmd) # ----------------------------------------------------------------------------- test: $(elc) $(so) emacs $(emfl) --module-assertions -l $< -f $(elt) # -----------------------------------------------------------------------------