# This will not work as a stand-alone make file - it must be
# called recursively from the make file in the directory above.

TARGET=plrand.$(SO)
PLLDFLAGS=-DHAVE_GSL=$(HAVE_GSL) -I$(GSL)/include -L$(GSL)/lib -lgsl -lm -fPIC -Wall -O2

.SUFFIXES: .c .o .so .dylib

main: $(TARGET)

$(TARGET): RngStream.o

clean:
	rm $(TARGET)
	rm RngStream.o

RngStream.o: RngStream.c
	gcc -O2 -c RngStream.c 

.c.so: 
	$(PLLD) -v $(PLLDFLAGS) -shared -o $@ RngStream.o $<
	strip -x $@

.c.dylib: 
	$(PLLD) -v $(PLLDFLAGS) -shared -o $@ RngStream.o $<
	strip -x $@

install:
	install $(INSTALL_FLAGS) $(TARGET) $(INSTALL_LIB_TO)

