Un runner fait en CSFML reprenant certaines mécaniques de jeu d'Orton and the princess.
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.

77 lines
1.3 KiB

#!/usr/bin/make -f
# ---
# Project: my_runner
# Author: yann.magnin@epitech.eu
# ---
include global.mk
# function
# $1 module name
# $2 file
define rule-module
build/$1_$(patsubst %.c,%,$2).o: src/$1/$2
$(cc) $(cflags) -c $$< -o $$@ $(header)
config = gcc.cfg
name = my_runner
header = -Iinclude/
module = core draw game memory menu text kinematic
build-dir = build
$(foreach mod,$(module), $(eval \
mod-$(mod)-src = $(notdir $(wildcard src/$(mod)/*.c)) $n\
mod-$(mod)-obj = $$(patsubst %.c,build/$(mod)_%.o,$$(mod-$(mod)-src)) \
target-obj = $(foreach mod, $(module), $(mod-$(mod)-obj))
# Chek configuration file
ifeq ($(wildcard $(config)),)
$(warning "Configuration file missing. skipping some compilation flags.")
cflags += -g0
cflags += @$(config)
all: check_lib $(name)
$(target-obj): | $(build-dir)
$(name): $(target-obj)
@ printf 'link binary $@\n'
$(cc) $(cflags) -o $@ $(target-obj) $(header) $(lib-link) -lgcc
@ printf 'create build folder:\033[1;35m $@\033[0m\n'
mkdir -p $@
make -C lib/
$(foreach mod, $(module), \
$(foreach source,$(mod-$(mod)-src), $(eval \
$(call rule-module,$(mod),$(source)))) \
## Clean rule
rm -rf $(name)
make clean -C lib/
fclean: clean
rm -rf build
make fclean -C lib/
re: fclean all
.PHONY: clean re fclean