#######################################################################
# WAD Test makefile
#
# Build some WAD test programs.
#######################################################################

CC= @CC@
CCSHARED = @CCSHARED@
LDSHARED = @LDSHARED@
RPATH    = @RPATH@

PYINCLUDE = @PYINCLUDE@
TCLINCLUDE = @TCLINCLUDE@
PERLINCLUDE = @PERL5EXT@
INCLUDE = -I../Include 
WADLIB = ..
WADLINK = -L$(WADLIB) $(RPATH)$(WADLIB)

test:
	$(CC) -g -DNEED_MAIN debug.c $(INCLUDE) $(WADLINK) -lwad -o debug

python: pydebug.c
	$(CC) $(CCSHARED) -c -g debug.c pydebug.c $(PYINCLUDE)
	$(LDSHARED) debug.o pydebug.o $(WADLINK) -lwadpy -o debugmodule.so

tcl: tcldebug.c
	$(CC) $(CCSHARED) -c -g debug.c tcldebug.c $(TCLINCLUDE)
	$(LDSHARED) debug.o tcldebug.o $(WADLINK) -lwadtcl -o debug.so

perl: pldebug.c
	$(CC) $(CCSHARED) -c -Dbool=char -g debug.c pldebug.c $(PERLINCLUDE)
	$(LDSHARED) debug.o pldebug.o $(WADLINK) -lwadpl -o debug.so

pydebug.c:
	swig -python -o pydebug.c debug.i

tcldebug.c:
	swig -tcl -o tcldebug.c debug.i

pldebug.c:
	swig -perl5 -o pldebug.c debug.i

clean:
	rm -f *.so *.o debug *_wrap*
