aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile36
1 files changed, 31 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 24a80cd..4c755b9 100644
--- a/Makefile
+++ b/Makefile
@@ -15,6 +15,7 @@ target = 1bitjam
int_dir = intermediate
data_dir = data
convimg = convimg
+convanim = convanim
packassets = packassets
pack = pack.h
@@ -43,19 +44,35 @@ endif
sources = \
1bitjam.c \
+ animation.c \
asset.c \
+ map.c \
maths.c \
memory.c \
+ physics.c \
plat.c \
+ player.c \
rect.c \
render.c \
image_sources = \
$(int_dir)/guy.bmp \
- $(int_dir)/hello.bmp
-
-objects = $(sources:%.c=%.o)
-images = $(image_sources:$(int_dir)/%.bmp=$(data_dir)/%.img)
+ $(int_dir)/map.bmp \
+ $(int_dir)/mask.bmp
+
+anim_sources = \
+ $(int_dir)/guy_fall_left.anm \
+ $(int_dir)/guy_fall_right.anm \
+ $(int_dir)/guy_idle_left.anm \
+ $(int_dir)/guy_idle_right.anm \
+ $(int_dir)/guy_jump_left.anm \
+ $(int_dir)/guy_jump_right.anm \
+ $(int_dir)/guy_run_left.anm \
+ $(int_dir)/guy_run_right.anm \
+
+objects = $(sources:%.c=%.o)
+images = $(image_sources:$(int_dir)/%.bmp=$(data_dir)/%.img)
+animations = $(anim_sources:$(int_dir)/%.anm=$(data_dir)/%.anm)
all: $(target) $(pack)
@@ -65,15 +82,22 @@ $(objects): %.o : %.c | $(pack)
$(images): $(data_dir)/%.img : $(int_dir)/%.bmp | $(convimg) $(data_dir)
./$(convimg) $< $@
-$(pack): $(packassets) $(images)
+$(animations): $(data_dir)/%.anm : $(int_dir)/%.anm | $(convanim) $(data_dir)
+ ./$(convanim) $< $@
+
+$(pack): $(packassets) $(images) $(animations)
./$(packassets) \
$(pack) \
$(data_dir) \
+ $(notdir $(animations)) \
$(notdir $(images))
$(convimg): convimg.c
$(tool_compiler) convimg.c $(cflags) -o $@
+$(convanim): convanim.c
+ $(tool_compiler) convanim.c $(cflags) -o $@
+
$(packassets): packassets.c
$(tool_compiler) packassets.c $(cflags) -o $@
@@ -89,5 +113,7 @@ clean:
rm $(pack)
rm -r $(data_dir)
rm $(target)
+ rm $(convimg)
+ rm $(convanim)
-include $(sources:%.c=%.d)