# makefile for AC3D plugin
# This works on Redhat 7.3 with gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-113)
# Does not on fedora 3.0

PLUGIN=wave3d
AC3D_DIR=/usr/local/ac3dlx
TEST_CMD=./ac3ds


INSTALLED_FLAG=Installed

all:    run


$(PLUGIN).o:		$(PLUGIN).cpp Makefile

$(PLUGIN).p:		$(PLUGIN).o
	g++ -shared $*.o -o $*.p
	chmod 755 $*.p



nm:	$(PLUGIN).p
	sleep 1; nm $(PLUGIN).p | less


install:  $(INSTALLED_FLAG)

$(INSTALLED_FLAG): $(PLUGIN).p
	cp $(PLUGIN).p $(AC3D_DIR)/plugins
	test -f $(PLUGIN).tcl && cp $(PLUGIN).tcl $(AC3D_DIR)/plugins || true
	touch $(INSTALLED_FLAG)

uninstall: 
	cd $(AC3D_DIR)/plugins && rm -f $(PLUGIN).p $(PLUGIN).tcl
	rm -f $(INSTALLED_FLAG)

list:
	cd $(AC3D_DIR)/plugins && ls -l


test: install run

run:	
	sleep 1
	cd $(AC3D_DIR); $(TEST_CMD)
debug:	
	sleep 1
	cd $(AC3D_DIR); $(TEST_CMD) -debug

clean:
	rm -f *.p *.o *.obj $(INSTALLED_FLAG)

# End
