# Copyright (c) 2000, 2001
#       Yes/No Software (Yoshiyuki Nakano). All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.

.SUFFIXES: .fx .bin .lib .obj .c .h .bmp .bmh

CC       = lcc86
RM       = rm -f
CFLAGS   =  -O
#CFLAGS   =  -O -DBMPSERVER
DEFINES  = 
INCLUDES = 
LIBS     = 

CRT0_ASCII1=crt0asc1.obj
CRT0_ASCII2=crt0asc2.obj
CRT0_JAPANESE1=crt0jpn1.obj
CRT0_JAPANESE2=crt0jpn2.obj
CRT0=$(CRT0_JAPANESE2)

OBJS    = main.obj locus.obj vscreen.obj gate.obj spark.obj \
          game.obj title.obj gameover.obj demo.obj \
          score.obj saku.obj palette.obj replay.obj
TARGET  = yoppa.fx

.c.obj:
	$(CC) -c $(CFLAGS) $(DEFINES) $(INCLUDES) $*.c
.bmp.bmh:
	bmpcnv -cformat $< $*.bmh
.bmp.fr:
	bmpcnv $<

all: $(TARGET)

$(TARGET): $(OBJS) niku32.fr
#	echo $(OBJS) > files
	$(CC) -a$(CRT0) -k-M -o $*.bin @files $(LIBS)
	mkfent $*.cf

game.obj: niku.bmh bg.bmh num2.bmh stage.bmh
title.obj: title.bmh
vscreen.obj: saku.bmh yuka.bmh num.bmh
gate.obj: gateu.bmh gated.bmh
spark.obj: spark.bmh
gameover.obj: nomisugi.bmh
demo.obj: mukae.bmh

install:
	wwPutw $(TARGET)

clean:
	$(RM) *.obj
	$(RM) *.bin
	$(RM) *.map
	$(RM) *.bmh
	$(RM) *.fr
	$(RM) $(TARGET)

main.obj: main.h game.h title.h gameover.h
game.obj: main.h vscreen.h locus.h spark.h
locus.obj: main.h vscreen.h locus.h
vscreen.obj: main.h vscreen.h
gate.obj: main.h vscreen.h gate.h
spark.obj: main.h vscreen.h spark.h
