#
#
#
#    Makefile.cs
#
#    Make recipes for building with Mono.
#
#    License: GNU General Public License Version 3.0.
#    
#    Copyright (C) 2017 by Matthew K. Roberts, KK5JY. All rights reserved.
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#    
#    This program is distributed in the hope that it will be useful, but
#    WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#    General Public License for more details.
#    
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see: http://www.gnu.org/licenses/
#    
#
#

# the compiler
MCS=mcs

# the installation folder (will put exe in $INSTALL_ROOT/bin, etc.)
INSTALL_ROOT=/usr/local

# the debug settings
DEBUG= -debug+ -define:DEBUG 

# the core files used for both the GUI and CLI versions
FILES=\
	JayLog/Properties/Settings.Designer.cs \
	JayLog/Properties/Resources.Designer.cs \
	JayLog/Properties/AssemblyInfo.cs \
	JayLog/Program.cs \
	JayLog/Adif.cs \
	JayLog/MainForm.Designer.cs \
	JayLog/MainForm.cs

WINFORM_REFS=\
	-resource:KK5JY.JayLog.MainForm.resources \
	-resource:KK5JY.JayLog.resources \
	-reference:System.Windows.Forms \
	-reference:System.Numerics \
	-reference:System.Drawing
# the application icon to show when browsing in Win32
WINICON=JayLog/JayLog.ico

# target definitions
TARGETS=JayLog.exe

# resource files for the GUI
RESOURCES=KK5JY.JayLog.MainForm.resources KK5JY.JayLog.resources

all: $(TARGETS)

KK5JY.JayLog.resources:
	resgen2 JayLog/Properties/Resources.resx KK5JY.JayLog.resources
KK5JY.JayLog.MainForm.resources:
	resgen2 JayLog/MainForm.resx KK5JY.JayLog.MainForm.resources
JayLog.exe: $(RESOURCES) $(FILES)
	$(MCS) $(DEBUG) -out:$@ -sdk:4 -target:winexe -win32icon:$(WINICON) $(FILES) $(REFS) $(WINFORM_REFS)
clean:
	rm -f *.exe *.mdb *.resources
rebuild: clean all
install:
	install -o root -g root -m 755 JayLog.exe $(INSTALL_ROOT)/bin/

# EOF
