#
# Copyright (C) 2010 Frederic Vecoven
#
# This file is part of NixieClock
#
# NixieClock 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.
#
# NixieClock 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/>.
#

ASM = gpasm
LINKER = gplink

SRC =	button.asm  \
	clock.asm \
	delay.asm \
	editor.asm \
	hv.asm \
	main.asm \
	math.asm \
	nixie.asm \
	prog_data.asm \
	program.asm \
	tables.asm \
	time.asm

OBJS = $(SRC:%.asm=%.o)
LSTS = $(SRC:%.asm=%.lst)

PROG = NIXIE

ZIP = nixie.zip


$(PROG): $(OBJS)
	$(LINKER) -o $(PROG).hex -s /usr/local/share/gputils/lkr/18f2321.lkr -m $(OBJS)


.PHONY: clean zip
clean:
	$(RM) -f $(OBJS) $(PROG).hex $(PROG).cod $(PROG).map $(PROG).lst $(LSTS) $(ZIP)

zip:
	$(RM) -f $(ZIP)
	zip $(ZIP) $(SRC) $(wildcard *.inc) $(wildcard *.hex) Makefile LICENSE


%.o : %.asm
	$(ASM) -c -e OFF $^ -o $@
