# Makefile for BuildCart utility
#   Invoke using "gmake"         (build)
#         or     "gmake clean"   (remove old intermediate files)
#         or     "gmake all"     (both 'clean' and 'build)
# Mahlon R. Smith, The Software Samurai
# Tools: GNU g++ 13.3.1 (C++17)
# 
# 20-Jun-2024

# Create the "prefix".
.RECIPEPREFIX = >

HFILES = BuildCart.hpp gString.hpp 


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

#** Build the application **
bcart: BuildCart.o gString.a 
> g++ -o bcart BuildCart.o gString.a 

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

#** Build the gString link library **
gString.a: gString.o
> ar -Pcrv gString.a gString.o

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

#** Build All **
.PHONY: all
all:
> gmake -si clean
> gmake --no-print-directory

#** Remove object files and binary **
.PHONY: clean
clean:
> rm --force $(OFILES) gString.a bcart

