###############################################################################
# PROJECT: cave
#
# Makefile for cave game
# with gcc compiler, target is Windows Linux or Mac
#
# AUTHOR: Dominique RIOUAL
#
# LOGS :
# 24/04/2023   v1.0   First release
#
#
###############################################################################
GCC=gcc
GCC_FLAG = -Wall 

NOM_PROG=cave
SRC=$(NOM_PROG).c 
EXE=$(NOM_PROG)

all: default

default : $(EXE)
	@echo "All targets updated."
	
$(EXE) : $(SRC)
	$(GCC) $(GCC_FLAG) $(SRC) -o $(EXE)

clean :
	rm -f *.o a.out core $(EXE)  *~

backup : $(SRC) makefile
	tar cvf $(HOME)/backup/$(NOM_PROG)_`date +%y%m%d`.tar $(SRC) makefile
	@echo "Backup completed."
