#
#  Makefile for kstrax 
#

#define macro
GCC    = gcc
OBJS   = kstrax.o kstrax_buf.o 
TARGET = kstrax
INCLUDE = ../module/
DEBUG = -g -O0

SBINDIR= /usr/sbin
PROGS = kstrax
SCRIPT= kstrax-simple kstrax-rec 

RM     = rm -f
VERSION = $(findstring 2.4,$(shell uname -r))

all:$(TARGET)

$(TARGET): $(OBJS)
	$(GCC) -o $@ $(OBJS) -Wall -lpthread 

#suffix rule
.c.o:
	$(GCC) -c $< -Wall -I $(INCLUDE)

install: $(TARGET)
	cp $(PROGS) $(SBINDIR); \
	cd ../script; \
	cp $(SCRIPT) $(SBINDIR);

uninstall:
	@( for p in $(PROGS) $(SCRIPT) ; do \
	  echo "rm -f" $(SBINDIR)/$$p; \
	  rm -f $(SBINDIR)/$$p; \
	done )

distclean: clean

clean:
	$(RM) $(TARGET) $(OBJS)

kstrax.o:kstrax.h kstrax_buf.h syscall_name.h
kstrax_buf.o:kstrax.h kstrax_buf.h syscall_name.h
