# Makefile for Peak-Seq Preprocessing Program
# 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 sgr.o io.o util.o
OBJ_P = parse.o io.o util.o

# Targets
TARGETS = Preprocessing

all: $(TARGETS)

# JH
Preprocessing: $(OBJ)
	gcc -o $@.so $(OBJ) $(LDFLAGS)

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

# Dependencies
util.o: util.c util.h
io.o: io.c io.h util.h
sgr.o: sgr.c sgr.h io.h util.h config.h
main.o: main.c sgr.h io.h util.h config.h

