59 lines
1.8 KiB
Makefile
59 lines
1.8 KiB
Makefile
PREFIX ?= /local
|
|
EXEC_PREFIX ?= $(PREFIX)
|
|
BINDIR ?= $(EXEC_PREFIX)/bin
|
|
|
|
CFLAGS ?= -O3 -Wall -Wextra -pedantic
|
|
|
|
.SUFFIXES:
|
|
.SUFFIXES: .inc .txt
|
|
|
|
NAME = switcher
|
|
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 \
|
|
switch1_off_tile.inc switch1_on_tile.inc \
|
|
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 \
|
|
tile1_off_tile.inc tile1_on_tile.inc \
|
|
tile2_off_tile.inc tile2_on_tile.inc \
|
|
tile3_off_tile.inc tile3_on_tile.inc \
|
|
tile4_off_tile.inc tile4_on_tile.inc \
|
|
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 \
|
|
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 \
|
|
rebind_jump1_tile.inc rebind_jump2_tile.inc \
|
|
rebind_rebind1_alt_tile.inc
|
|
|
|
all: $(NAME)
|
|
|
|
$(NAME): $(NAME).c $(TILES)
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $< -ldisplay
|
|
|
|
.txt.inc:
|
|
./tile_compiler.py $< > $@
|
|
|
|
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 > $@
|
|
|
|
run: $(NAME)
|
|
./$(NAME)
|
|
|
|
clean:
|
|
rm -f $(NAME) $(TILES)
|
|
|
|
distclean: clean
|
|
|
|
install: $(NAME)
|
|
mkdir -p $(DESTDIR)$(BINDIR)
|
|
install $(NAME) $(DESTDIR)$(BINDIR)/$(NAME)
|
|
|
|
.PHONY: all clean distclean install
|