# https://dataswamp.org/~incal/bad-el/src/Makefile el-files = $(shell sh -c "ls -1 *.el") elc-files = $(el-files:.el=.elc) nom = bad-sdl src = $(nom).c hdr = $(nom).h obj = $(nom).o so = $(nom).so 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) all: $(xo) $(elc-files) $(obj): $(src) $(comp) -c $< -o $@ $(so): $(obj) $(comp) -o $@ $< $(libs) %.elc: %.el $(so) \emacs -q -batch -L "." -f batch-byte-compile $< 2>&1 1> /dev/null \emacs -q -batch -L "." -f batch-byte-compile $< \emacs -q -batch -L "." -f batch-native-compile $< clean: rm -f *.elc *.o *.so clear: make clean again: make clean make all kill: pkill -9 gmake kill -9 $(pidof gmake) pkill -9 sdl-cache kill -9 $(pidof sdl-cache) pkill -9 sdl-surface kill -9 $(pidof sdl-surface) pkill -9 sdl-rusface kill -9 $(pidof sdl-rusface) studio: bad-studio.elc \emacs -q -l $< -f bad-studio 2> /dev/null 1> /dev/null studio-nw: bad-studio.elc \emacs -q -nw -l $< -f bad-studio 2> /dev/null 1> /dev/null snake: bad-snake.elc \emacs -q -l $< -f bad-snake snake-nw: bad-snake.elc \emacs -q -nw -l $< -f bad-snake 2> /dev/null 1> /dev/null fps: bad-ecs.elc $(so) \emacs -q -nw -l $< -f bad-sdl-fps -f kill-emacs solar: bad-ecs.elc $(so) \emacs -q -l $< -f bad-sdl-solar -f kill-emacs 2> /dev/null 1> /dev/null d: bad-ecs.elc $(so) \emacs -q -l $< -f bad-sdl-3d -f kill-emacs 2> /dev/null 1> /dev/null meta: grep "\-\>" *.el | sort -u