switcher/Makefile

60 lines
1.8 KiB
Makefile
Raw Normal View History

2022-07-27 22:46:29 +00:00
PREFIX ?= /local
2022-01-15 17:34:32 +00:00
EXEC_PREFIX ?= $(PREFIX)
BINDIR ?= $(EXEC_PREFIX)/bin
2022-07-27 22:48:37 +00:00
CFLAGS ?= -O3 -Wall -Wextra -pedantic
2022-01-15 15:21:30 +00:00
.SUFFIXES:
.SUFFIXES: .inc .txt
2022-01-15 17:30:00 +00:00
NAME = switcher
2022-01-15 17:27:23 +00:00
TILES = player_stand_tile.inc \
player_walk1_tile.inc player_walk1_tile_reversed.inc \
player_walk2_tile.inc player_walk2_tile_reversed.inc \
grass_tile.inc dirt_tile.inc flag_tile.inc \
2022-01-15 16:52:16 +00:00
switch1_off_tile.inc switch1_on_tile.inc \
2022-01-16 15:15:26 +00:00
switch2_off_tile.inc switch2_on_tile.inc \
switch3_off_tile.inc switch3_on_tile.inc \
switch4_off_tile.inc switch4_on_tile.inc \
switch0_off_tile.inc switch0_on_tile.inc \
2022-01-15 16:52:16 +00:00
tile1_off_tile.inc tile1_on_tile.inc \
2022-01-16 15:15:26 +00:00
tile2_off_tile.inc tile2_on_tile.inc \
tile3_off_tile.inc tile3_on_tile.inc \
tile4_off_tile.inc tile4_on_tile.inc \
2022-01-16 14:38:47 +00:00
stage1_tile.inc stage2_tile.inc stage3_tile.inc stage4_tile.inc \
stage5_tile.inc stage6_tile.inc stage7_tile.inc stage8_tile.inc \
star_tile.inc \
2022-01-16 14:26:29 +00:00
rebind_rebind1_tile.inc rebind_rebind2_tile.inc rebind_rebind3_tile.inc \
rebind_left1_tile.inc rebind_left2_tile.inc \
rebind_right1_tile.inc rebind_right2_tile.inc \
2022-07-27 22:51:32 +00:00
rebind_jump1_tile.inc rebind_jump2_tile.inc \
rebind_rebind1_alt_tile.inc
2022-01-14 14:03:24 +00:00
all: $(NAME)
2022-01-15 15:21:30 +00:00
$(NAME): $(NAME).c $(TILES)
2022-07-27 22:48:37 +00:00
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $< -ldisplay
2022-01-14 14:03:24 +00:00
2022-01-15 15:21:30 +00:00
.txt.inc:
./tile_compiler.py $< > $@
2022-01-15 17:27:23 +00:00
player_walk1_tile_reversed.inc: player_walk1_tile.txt
./tile_compiler.py $< reversed > $@
player_walk2_tile_reversed.inc: player_walk2_tile.txt
./tile_compiler.py $< reversed > $@
2022-01-14 14:03:24 +00:00
run: $(NAME)
./$(NAME)
clean:
2022-01-15 15:21:30 +00:00
rm -f $(NAME) $(TILES)
2022-01-14 14:03:24 +00:00
distclean: clean
2022-01-15 17:34:32 +00:00
install: $(NAME)
mkdir -p $(DESTDIR)$(BINDIR)
install $(NAME) $(DESTDIR)$(BINDIR)/$(NAME)
.PHONY: all clean distclean install