# Makefile for idpp -  Invoke using "gmake" or "gmake clean"
#                      Invoke static build using "gmake static"
#                      Refresh NcDialog files: "gmake refreshlib"
# Mahlon R. Smith
# Tools: G++ / Gcc 10.1.1 for Linux (Fedora 31)
#        NcDialog link library (interactive mode)
#        ncursesw link library (interactive mode)
# 
# 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.
# 
# 
# 03-Jul-2020

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

HFILES = idpp.hpp idpp_file.hpp gString.hpp 
OFILES = idpp.o idpp_file.o gString.o

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


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

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

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

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


.PHONY: static
static: $(OFILES)
> g++ -o idpp_s -static $(OFILES)


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

