# ----------------------------------------------------------------------------- # this file: # https://dataswamp.org/~incal/emacs-init/draw/Makefile # ----------------------------------------------------------------------------- mkef = -j -s mcmd = $(MAKE) $(mkef) # ----------------------------------------------------------------------------- name = draw incl = include el = $(name).el elc = $(name).elc c = $(name).c so = $(name).so # ----------------------------------------------------------------------------- ll-name = luki-lisp ll-dir = ../ll ll-el = $(ll-dir)/$(ll-name).el ll-elc = $(ll-dir)/$(ll-name).elc # ----------------------------------------------------------------------------- sdlc = $(shell sdl2-config --cflags) sdll = $(shell sdl2-config --libs) -lSDL2_ttf # ----------------------------------------------------------------------------- emfl = --batch -Q -D -nw # ----------------------------------------------------------------------------- cc = gcc warn = -Wall -Wextra -pedantic-errors ccfl = -shared -fPIC -std=c99 -Os $(warn) -I $(incl) $(sdlc) comp = $(cc) $(ccfl) libs = -s $(sdll) # ----------------------------------------------------------------------------- all: $(so) $(elc) # ----------------------------------------------------------------------------- $(so): $(c) new.c $(comp) -o $@ $^ $(libs) # ----------------------------------------------------------------------------- $(elc): $(el) $(ll-elc) emacs $(emfl) -L $(ll-dir) -f batch-byte-compile $< 2>&1 > /dev/null emacs $(emfl) -L $(ll-dir) -f batch-byte-compile $< emacs $(emfl) -L $(ll-dir) -f batch-native-compile $< # ----------------------------------------------------------------------------- $(ll-elc): $(ll-el) emacs $(emfl) -f batch-byte-compile $< 2>&1 > /dev/null emacs $(emfl) -f batch-byte-compile $< emacs $(emfl) -f batch-native-compile $< # ----------------------------------------------------------------------------- clean: rm -f $(elc) $(so) # ----------------------------------------------------------------------------- again: $(mcmd) clean $(mcmd) # ----------------------------------------------------------------------------- test: $(elc) $(ll-elc) $(so) emacs $(emfl) --module-assertions -l $< -f sdl2-init # -----------------------------------------------------------------------------