Source

perlxs / Makefile

all: main libtest.so test.so

libtest.so: libtest.c
	gcc -o $@ -shared -fPIC $<

main: main.c libtest.so
	gcc -o $@ -L. -ltest $<

test.so: test.c libtest.so
	x86_64-pc-linux-gnu-gcc -c  -I. -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -pipe -Wdeclaration-after-statement -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -march=nocona -pipe   -DVERSION=\"0.01\" -DXS_VERSION=\"0.01\" -fPIC "-I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE"   test.c
	x86_64-pc-linux-gnu-gcc -L. -ltest -shared -L/usr/local/lib64  test.o -o $@

test.c: test.xs ppport.h
	rm -f test.c
	/usr/bin/perl5.8.8 /usr/lib64/perl5/5.8.8/ExtUtils/xsubpp -typemap /usr/lib64/perl5/5.8.8/ExtUtils/typemap $< > $@

clean:
	rm -f *.so *.o main

.PHONY: all clean