
# Makefile for PeakSeq Program Version 1.01
# Paper by Joel Rozowsky, et. al.
# Coded in C by Theodore Gibson.

# Modify these parameters to fit the computing environment, so that the shared libraries are callable from R
CFLAGS = -std=gnu99 -I/usr/share/R/include -fpic -g -O2 -c -Wall -pedantic
LDFLAGS =  -std=gnu99 -shared -L/usr/lib/R/lib

# Object files
OBJ = main.o window.o simulator.o filter.o analyze.o random.o io.o util.o

# Targets
TARGETS = PeakSeq_v1.01

all: $(TARGETS)

# JH
PeakSeq_v1.01: $(OBJ)
	gcc -o $@.so $(OBJ) -lm $(LDFLAGS)

clean:
	rm -f $(TARGETS) $(OBJ) *~


# Dependencies
util.o: util.c util.h
io.o: io.c io.h util.h
random.o: random.c random.h
analyze.o: analyze.c analyze.h io.h util.h config.h
filter.o: filter.c filter.h analyze.h io.h util.h config.h
simulator.o: simulator.c simulator.h window.h random.h util.h config.h
window.o: window.c window.h filter.h analyze.h io.h util.h config.h
main.o: main.c window.h simulator.h filter.h analyze.h random.h io.h util.h config.h
