# https://dataswamp.org/~incal/bad-el/src/bad-sdl3/Makefile mkef = -j -s mcmd = $(MAKE) $(mkef) nom = bad-sdl3 el = $(nom).el elc = $(nom).elc obj = $(nom).o src = $(nom).c hdr = $(nom).h so = $(nom).so log = $(nom).log sdld = /usr/include sdlf = -D_REENTRANT -I /$(sdld)/libdrm -I $(sdld)/libdecor-0 -I $(sdld)/pipewire-0.3 -I $(sdld)/spa-0.2 sdll = -lSDL3 -lSDL3_image -lSDL3_ttf warn = -pedantic-errors -Wall -Wextra ccfl = -fPIC --shared --std=c11 $(warn) $(sdlf) -D_NDEBUG comp = gcc $(ccfl) libs = -lssl -lcrypto $(sdll) run_opts = -q -D cmp_opts = $(run_opts) -batch -L ".." dbg_opts = $(run_opts) --module-assertions --eval '(setq debug-on-error t)' all: $(elc) $(so) $(so): $(obj) $(comp) -o $@ $^ $(libs) %.o: %.c $(comp) -c $< -o $@ $(elc): $(el) \emacs $(cmp_opts) -f batch-byte-compile $< 2> /dev/null 1> /dev/null \emacs $(cmp_opts) -f batch-byte-compile $< \emacs $(cmp_opts) -f batch-native-compile $< clean: $(mcmd) --makefile ../Makefile clean rm -f $(elc) $(obj) $(so) $(log) clear: $(mcmd) clean again: $(mcmd) --makefile ../Makefile again $(mcmd) fps: $(elc) $(so) $(mcmd) --makefile ../Makefile \emacs $(run_opts) -l $< -f sdl3-fps -f kill-emacs 2> $(log) solar: $(elc) $(so) $(mcmd) --makefile ../Makefile \emacs $(run_opts) -l $< -f sdl3-solar -f kill-emacs 2> $(log) kill: pkill -9 gmake kill -9 $(pidof gmake) pkill -9 sdl3-cache kill -9 $(pidof sdl3-cache) pkill -9 sdl3-surface kill -9 $(pidof sdl3-surface) pkill -9 sdl3-rusface kill -9 $(pidof sdl3-rusface)