

EXEC=orgasmi

ORGASMI_SRC= fastq.c \
             encode.c \
             decode.c \
             buffer.c \
             debug.c \
             malloc.c \
             sort.c \
             indexoutput.c \
             indexinput.c \
             code16bits.c \
             codecomp.c \
             buildindex.c \
             compsort.c \
             load.c \
             lookfor.c \
             fgetln.c \
             orgasmi.c  
             
ORGASMD_SRC= fastq.c \
             encode.c \
             decode.c \
             buffer.c \
             debug.c \
             malloc.c \
             sort.c \
             indexoutput.c \
             indexinput.c \
             code16bits.c \
             codecomp.c \
             buildindex.c \
             compsort.c \
             load.c \
             lookfor.c \
             orgasmd.c  
             
ORGASMI_OBJ= $(patsubst %.c,%.o,$(ORGASMI_SRC))
ORGASMD_OBJ= $(patsubst %.c,%.o,$(ORGASMD_SRC))



SRCS= $(ORGASMI_SRC)

LIB= -lz -lm -lpthread

LIBFILE= 

include global.mk

all: $(EXEC) expand8bits.c


########
#
# ecoPCR compilation
#
########

# executable compilation and link

littlebigman: littlebigman.c
	$(CC) -o $@ $<
	
buildcode: buildcode.c littlebigman
	$(CC) -o $@ $(shell ./littlebigman) $<
	
buildexpand8bits: buildexpand8bits.c littlebigman
	$(CC) -o $@ $(shell ./littlebigman) $<
	
buildcomplement: buildcomplement.c littlebigman
	$(CC) -o $@ $(shell ./littlebigman) $<

orgasmi: littlebigman $(ORGASMI_OBJ) $(LIBFILE) 
	$(CC) $(LDFLAGS) -o $@ $(ORGASMI_OBJ) $(LIBPATH) $(LIB)
	
orgasmd: littlebigman $(ORGASMD_OBJ) $(LIBFILE) 
	$(CC) $(LDFLAGS) -o $@ $(ORGASMD_OBJ) $(LIBPATH) $(LIB)
	
	
code16bits.c: buildcode
	./$< > $@

codecomp.c: buildcomplement
	./$< > $@
	
expand8bits.c: buildexpand8bits
	./$< > $@

########
#
# project management
#
########

clean:
	rm -f *.o	
	rm -f $(EXEC)
	rm -f buildcode buildcomplement buildexpand8bits
	rm -f code16bits.c codecomp.c expand8bits.c


		
