#~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/
# Makefile for ikweeder
#~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/


#------------------------------------
# Set suffixes
#------------------------------------
.SUFFIXES: .c .o .do

#------------------------------------
# Settings
#------------------------------------

#------------------------------------
# Environment
#------------------------------------
CC          = gcc
DEBUGFLAGS  = -DDEBUG -g -Wall -D_LINUX
CFLAGS      = -O2 -Wall -D_LINUX
DLIBS       = -Lenfence
LIBS        =
OBJS        = crc32.o weeder.o bufstore.o stuff.o
DOBJS       = crc32.do weeder.do bufstore.do stuff.do
EXECNAME    = weeder
DEBUGEXE    = dweeder

all: weeder


#------------------------------------
# suffix rule to make the executable
#------------------------------------
.c.o:; $(CC) -c $(CFLAGS) -o $@ $<
.c.do:; $(CC) -c $(DEBUGFLAGS) -o $@ $<


#------------------------
# Generate executable
#------------------------
$(EXECNAME): $(OBJS)
	$(CC) -o $(EXECNAME) $(OBJS) $(LIBS)

#------------------------
# Generate DebugVersion
#------------------------
$(DEBUGEXE): $(DOBJS)
	$(CC) -o $(DEBUGEXE) $(DOBJS) $(DLIBS)


#------------------------
# Dependencies
#------------------------
crc32.o.do: crc32.c crc32.h macros.h
bufstore.o.do: bufstore.c bufstore.h macros.h
weeder.o.do: weeder.c weeder.h macros.h messages.h bufstore.c bufstore.h \
	stuff.c stuff.h

