# Makefile for Dialog2  -  Invoke using "gmake" or "gmake clean"
# Mahlon R. Smith
# Tools: See information on development tools in: "../Dialog1/Makefile"
# 11-Mar-2021

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

# Files for Dialog2 Application
HFILES = DialogAppShared.hpp GlobalDef.hpp NCurses.hpp NCursesKeyDef.hpp \
         NcWindow.hpp NcDialog.hpp gString.hpp WaylandCB.hpp \
         KeyTest.hpp ColorTest.hpp MenuTest.hpp
LFILES = NcDialog.a
OFILES = Dialog2.o KeyTest.o ColorTest.o CapTest.o MenuTest.o StreamTest.o

COMPILE = g++ -x c++ -std=gnu++11 -Wall -c
# Special compile: stop-on-error
#COMPILE = g++ -x c++ -std=gnu++11 -Wall -fmax-errors=1 -c

#** NOTE: The NcDialog link library is compiled as part of the Dialog1 build. **
Dialog2: $(OFILES) $(LFILES)
> g++ -o Dialog2 $(OFILES) NcDialog.a -lncursesw

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

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

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

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

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

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


#** Remove old object files and the executable for a clean build **
.PHONY: clean
clean:
> rm -f $(OFILES) Dialog2 1>/dev/null 2>/dev/null

