RM = /bin/rm
CAT = /bin/cat
CC = gcc

CFLAGS = \
	-g -W -Wall -ansi -pedantic -Wbad-function-cast -Wcast-align \
	-Wcast-qual -Wchar-subscripts -Winline \
	-Wmissing-prototypes -Wnested-externs -Wpointer-arith \
	-Wredundant-decls -Wshadow -Wstrict-prototypes \
	-Wpointer-arith -Wno-long-long \
	-Wcomment \
	-O -Wuninitialized

CPPFLAGS = \
    -Isrc_internal/ \
    -Iinterface

LFLAGS = \
    -lssl \
    -lcrypto

BIN   =  grid-proxy-verify

OBJS  =  \
	src_internal/_verify_x509.o \
	src_internal/verify_x509_utils.o \
	src_internal/log.o \
	src/verify_x509.o \
	main.o


all: $(BIN)
	./$(BIN) -h && ./$(BIN) -d -d -d


$(BIN): $(OBJS)
	$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $(OBJS) $(LFLAGS)


$(OBJS): \
	src_internal/log.h \
	interface/verify_x509.h

.c.o:
	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@

clean:
	$(RM) -f $(BIN) $(OBJS) *~

distclean: clean
