###############################################################################
# rhEs@:                                                         #
# "C:\Program Files (x86)\Microsoft Visual Studio\VC98\Bin\VCVARS32.BAT"    #
# make run                                                                  #
# ̃CNt@ĆADOSŃRpCꍇɎgpĂB       #
# Visual Studio 6.0ŃRpCꍇ́AdSndSeqC.dswgpĂB #
# ǂ̕@łAst@C͂łB                  #
###############################################################################

ifndef CLIP
#CLIP = ..
CLIP = ..\clip
endif #CLIP

PROJECT = dSndSeqC

OBJS =	winapp.obj \
	y.tab.obj \
	lex.yy.obj \
	\
	clipmisc.obj \
	clipsrch.obj \
	clipcrc.obj \
	getopt.obj \

HEADERS = winapp.h \
	  y.tab.h \

LIBS =	gc.lib \
	setargv.obj \

all: exe
exe: $(PROJECT).exe
run: exe
	$(PROJECT).exe
clean:
	@if exist *.exe    del *.exe
	@if exist *.obj    del *.obj
	@if exist y.tab.h  del y.tab.h
	@if exist y.tab.c  del y.tab.c
	@if exist y.output del y.output
	@if exist lex.yy.c del lex.yy.c

#############################################################################

TOOL    = $(CLIP)\tool
GC      = $(TOOL)\gc

CC      = cl.exe -nologo
CFLAGS  = -W3 -O2 -I"." -I"$(CLIP)" -I"$(GC)" -DEXTCLIPH -DYYDEBUG=1 -DYYERROR_VERBOSE
LD      = cl.exe -nologo
LDFLAGS = -LIBPATH:"$(GC)"

.SUFFIXES:
.SUFFIXES: .c .obj

.c.obj:
	$(CC) -c $(CFLAGS) $<

%.obj: $(CLIP)\%.c
	$(CC) -c $(CFLAGS) $<

$(PROJECT).exe: $(OBJS)
	$(LD) -Fe$@ $(OBJS) $(LIBS) -link $(LDFLAGS)

$(OBJS): $(HEADERS)

#############################################################################

YACC    = bison		# GNU Project parser generator (yacc replacement)
YFLAGS  = --yacc	# Equivalent to -o y.tab.c; the parser output file is called y.tab.c, and the other outputs are called y.output and y.tab.h.
#YFLAGS += --no-lines	# Don't put any #line preprocessor commands in the parser file.
YFLAGS += --defines	# Write an extra output file containing macro definitions for the token type names defined in the grammar and the semantic value type YYSTYPE, as well as a few extern variable declarations.
YFLAGS += --verbose	# Write an extra output file containing verbose descriptions of the parser states and what is done for each type of look-ahead token in that state.
LEX     = flex		# fast lexical analyzer generator
#LFLAGS  = -L		# instructs flex not to generate #line directives.
LFLAGS += -s		# causes the default rule (that unmatched scanner input is echoed to stdout) to be suppressed.

.SUFFIXES: .y .l

.y.c:
	$(YACC) $(YFLAGS) $<
.l.c:
	$(LEX)  $(LFLAGS) $<

y.tab.h: y.tab.c

