# Makefile MODULE=helloworld TYPEMAP=/usr/local/lib/perl5/5.8.7/ExtUtils/typemap XSUBPP=/usr/local/lib/perl5/5.8.7/ExtUtils/xsubpp PERLCORE=/usr/local/lib/perl5/5.8.7/i686-linux/CORE CC=gcc .PHONY: init clean all : init libhelloworld.so init : perl -e "use Devel::PPPort; use ExtUtils::Constant qw (WriteConstants); \ Devel::PPPort::WriteFile(); WriteConstants(NAME => '$(MODULE)')" libhelloworld.so : helloworld.o $(CC) -shared helloworld.o -o $@ helloworld.c : helloworld.xs perl $(XSUBPP) -typemap $(TYPEMAP) helloworld.xs >$@ helloworld.o : helloworld.c $(CC) -Wall -fPIC -I$(PERLCORE) -I. -c helloworld.c -Wl,-rpath,. -o $@ clean : rm -f helloworld.o helloworld.c const-c.inc const-xs.inc ppport.h clean-all : clean rm -f libhelloworld.so