An endless runner game. https://huitsi.net/ParallelOverhead/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
ParallelOverhead/Makefile

87 lines
2.2 KiB

#Copyright © 2020 Linus Vanas <linus@vanas.fi>
#SPDX-License-Identifier: MIT
prefix = /usr/local
bindir = $(prefix)/games
datadir = $(prefix)/share/games
appsdir = $(prefix)/share/applications
icondir = $(prefix)/share/icons/hicolor
dbindir = $(DESTDIR)$(bindir)
ddatadir = $(DESTDIR)$(datadir)
dappsdir = $(DESTDIR)$(appsdir)
dicondir = $(DESTDIR)$(icondir)
CFLAGS = -Wall -O3
C = $(wildcard src/*.c)
O = $(patsubst src/%.c, build/%.o, $C)
D = $(patsubst %.o, %.d, $O)
LMMS = lmms
SFXR = sfxr-qt
data = $(notdir $(wildcard data/*.bmp) $(wildcard data/*.glsl))
build_data = move.wav death.wav fast_pulse.wav
install_bin = $(dbindir)/parallel_overhead
install_data = $(addprefix $(ddatadir)/parallel_overhead/, $(data))
install_built_data = $(addprefix $(ddatadir)/parallel_overhead/, $(build_data))
install_app = $(dappsdir)/parallel_overhead.desktop
install_icon = $(dicondir)/48x48/apps/parallel_overhead.png
install_files = $(install_bin) $(install_data) $(install_built_data) $(install_icon) $(install_app)
.PHONY: all clean install uninstall
all: build/parallel_overhead $(addprefix build/, $(build_data))
clean:
$(RM) -r build
install: $(install_files)
uninstall:
$(RM) $(install_app)
$(RM) $(install_icon)
$(RM) $(dbindir)/parallel_overhead
$(RM) -r $(ddatadir)/parallel_overhead
$(install_bin): build/parallel_overhead
install -D $^ $@
$(install_data): $(ddatadir)/parallel_overhead/%: data/%
install -m644 -D $^ $@
$(install_built_data): $(ddatadir)/parallel_overhead/%: build/%
install -m644 -D $^ $@
$(install_icon): app/parallel_overhead.png
install -m644 -D $^ $@
$(install_app): app/parallel_overhead.desktop
desktop-file-install --dir=$(@D) $^
build/config.h: | build
echo '#define VERSION "'$$(git describe)\" > $@
build/%.d: src/%.c | build/config.h
$(CC) $(CPPFLAGS) -MM -MT build/$*.o $< -MF $@
build/%.o: src/%.c build/%.d
$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
build/parallel_overhead: $O | build
$(CC) $(LDFLAGS) $^ -lSDL2 -lGLESv2 -lm -o $@
build/fast_pulse.wav: data-src/fast_pulse.mmp | build
$(LMMS) render $^ $(LMMSFLAGS) -o $@
build/%.wav: data-src/%.sfxj | build
$(SFXR) --export $^ $(SFXRFLAGS) -o $@
build:
mkdir build
include $D