# Makefile for ctrash -  Invoke using "gmake" or "gmake clean"
#                        Invoke static build using "gmake static"
# Mahlon R. Smith
# Tools: G++ / Gcc 9.2.1 20190827 for Linux (Fedora 30)
# 
# 1) For distribution:
#    Build both 32-bit and 64-bit x86 static executables
# 2) Use the '-static' link option on the distribution build, 
#    so shared libraries will not be used.
# 
# 
# 17-Jan-2020

# This variable is defined for technical reasons
# (see 'make' documentation for more information)
.RECIPEPREFIX = >

HFILES = cTrash.hpp cTrashFile.hpp gString.hpp 
OFILES = cTrash.o cTrashFile.o cTrashCan.o gString.o

COMPILE = g++ -x c++ -std=gnu++11 -Wall -c

# [interactive mode not yet implemented]

ctrash: $(OFILES)
> g++ -o ctrash $(OFILES)

cTrash.o: cTrash.cpp $(HFILES) 
> $(COMPILE) cTrash.cpp

cTrashFile.o: cTrashFile.cpp $(HFILES) 
> $(COMPILE) cTrashFile.cpp

cTrashCan.o: cTrashCan.cpp $(HFILES) 
> $(COMPILE) cTrashCan.cpp

gString.o: gString.cpp gString.hpp
> $(COMPILE) gString.cpp


.PHONY: static
static: $(OFILES)
> g++ -o ctrash_s64 -static $(OFILES)
#> g++ -o ctrash_s32 -static $(OFILES)


#** Remove old object files and the executable for a clean build **
.PHONY: clean
clean:
> rm $(OFILES) ctrash*

