From 26c1fda1439031ed4b87e791df8a96f298a873ce Mon Sep 17 00:00:00 2001
From: Allanis <allanis@saracraft.net>
Date: Sat, 8 Mar 2014 00:10:54 +0000
Subject: [PATCH] [Change] Build system improvements. [Change] Lowered debug
 level from -g3 to -g to reduce size.

---
 bin/Makefile | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/bin/Makefile b/bin/Makefile
index 9c04429..9e903ad 100644
--- a/bin/Makefile
+++ b/bin/Makefile
@@ -40,7 +40,7 @@ endif
 ifdef DEBUG
 CFLAGS += -W -Wall -Wextra -Wunused -Wshadow -Wpointer-arith -Wmissing-prototypes \
 					-Winline -Wcast-align -Wmissing-declarations -fstack-protector \
-					-fstack-protector-all -g3 -DDEBUG -DLUA_USE_APICHECK -std=c99
+					-fstack-protector-all -g -DDEBUG -DLUA_USE_APICHECK -std=c99
 
 ifdef DEBUG_PARANOID
 CFLAGS += -DDEBUG_PARANOID
@@ -91,7 +91,7 @@ DATA      := 	ldata
 DATAFILES := 	$(DATA_AI) $(DATA_GFX) $(DATA_XML) $(DATA_SND) $(DATA_MISN)
 
 # TARGETS.
-.PHONY: all help lua utils docs clean purge
+.PHONY: all help lua utils docs clean distclean
 
 %.o: %.c %.h
 	@$(CC) -c $(CFLAGS) -o $@ $<
@@ -101,16 +101,16 @@ all: utils ldata lua lephisto
 
 help:
 	@echo "Possible targets are:":
-	@echo "		lua 			- Makes Lua."
-	@echo "		lephisto 	- Makes the Lephisto binary."
-	@echo "		mkspr			- Makes the mkspr utility."
+	@echo "		lua 			- Builds Lua support."
+	@echo "		lephisto 	- Builds the Lephisto binary."
+	@echo "		mkspr			- Builds the mkspr utility."
 	@echo "		ldata			- Creates the ldata file."
-	@echo "		utils			- Makes all the utilities."
+	@echo "		utils			- Builds all the utilities."
 	@echo "		docs			- Creates the doxygen documentation."
 	@echo "		clean			- Removes Lephisto's main binary and ldata file."
-	@echo " 	purge			- Removes everything done."
+	@echo " 	distclean	- Removes everything done."
 
-lephisto: $(OBJS)
+$(APPNAME): $(OBJS)
 	@$(CC) $(LDFLAGS) -o $(APPNAME) $(OBJS) ../lib/lua/liblua.a
 	@echo "		LD $(APPNAME)"
 
@@ -140,15 +140,17 @@ docs:
 clean:
 	@echo "		Removing ldata"
 	@$(RM) $(DATA)
-	@$(RM) $(OBJS)
 	@echo "		Removing object files"
+	@$(RM) $(OBJS)
+	@echo "		Removing main binary ($(APPNAME))"
+	@$(RM) $(APPNAME)
 
-purge: clean
+distclean: clean
 	@echo "		Cleaning utilites"
 	@$(MAKE) -C ../utils/pack clean
 	@$(MAKE) -C ../utils/mkspr clean
 	@echo "		Cleaning Lua"
 	@$(MAKE) -C ../lib/lua clean
-	@echo "		Removing binaries."
+	@echo "		Removing build tool binaries."
 	@$(RM) Lephisto mksprite ldata pack gmon.out VERSION