# ----------------------------------------------------------------------------- # 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 so = $(name).so # ----------------------------------------------------------------------------- src = draw.c draw_thread.c new.c obj = $(src:.c=.o) # ----------------------------------------------------------------------------- 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 = -Q -D --debug-init emflb = $(emfl) --batch -nw emflm = $(emfl) --module-assertions emflbm = $(emflb) --module-assertions # ----------------------------------------------------------------------------- cc = gcc warn = -Wall -Wextra -pedantic-errors ccfl = -shared -fPIC -std=c99 -Os $(warn) -I $(incl) $(sdlc) comp = $(cc) $(ccfl) libs = -s $(sdll) # ----------------------------------------------------------------------------- all: $(elc) $(ll-elc) $(so) # ----------------------------------------------------------------------------- $(so): $(obj) $(comp) -o $@ $^ $(libs) # ----------------------------------------------------------------------------- %.o: %.c $(comp) -c $< -o $@ # ----------------------------------------------------------------------------- $(elc): $(el) $(ll-elc) emacs $(emflb) -L $(ll-dir) -f batch-byte-compile $< 2>&1 > /dev/null emacs $(emflb) -L $(ll-dir) -f batch-byte-compile $< emacs $(emflb) -L $(ll-dir) -f batch-native-compile $< # ----------------------------------------------------------------------------- $(ll-elc): $(ll-el) emacs $(emflb) -f batch-byte-compile $< 2>&1 > /dev/null emacs $(emflb) -f batch-byte-compile $< emacs $(emflb) -f batch-native-compile $< # ----------------------------------------------------------------------------- clean: rm -f $(elc) $(obj) $(so) # ----------------------------------------------------------------------------- again: $(mcmd) clean $(mcmd) # ----------------------------------------------------------------------------- test: $(elc) $(ll-elc) $(so) emacs $(emflbm) -l $< -f sdl2-init 2>&1 | grep -v Gtk thread: $(elc) $(ll-elc) $(so) emacs -l $< sdl2-helper.el 2>&1 | grep -v Gtk # -----------------------------------------------------------------------------