# Makefile for temp-watch, based off of Hobbits netcat makefile.
# invoke with "make systype" -- if your systype is not defined try "generic"
# if you port to other systems please mail the diffs to mudge@l0pht.com

### PREDEFINES

# DEFAULTS, possibly overridden by <systype> recursive call:
# pick gcc if you'd rather , and/or do -g instead of -O if debugging
# debugging
# DFLAGS = -DTEST -DDEBUG
DFLAGS = 
CFLAGS =-g -O -Wall
XFLAGS =        # xtra cflags, set by systype targets
XLIBS =         # xtra libs if necessary?
# -Bstatic for sunos,  -static for gcc, etc.  You want this, trust me.
STATIC =
CC = gcc $(CFLAGS)
#LD = $(CC) -s   # linker; defaults to stripped executables
LD = $(CC)    # linker; defaults to stripped executables
INIT_RACE_OBJS = util.o init_race.o list.o

ALL = init_race

 
### BOGON-CATCHERS

bogus:
	@echo "Usage:  make  <systype>  [options]"
	@echo "   <systype> can be: linux,generic"

### HARD TARGETS

init_race:	$(INIT_RACE_OBJS)
	$(LD) $(DFLAGS) $(XFLAGS) $(STATIC) -o init_race \
	$(INIT_RACE_OBJS) $(XLIBS)

util.o:	util.c
	$(CC) $(DFLAGS) $(XFLAGS) $(STATIC) -c util.c

init_race.o:	init_race.c
	$(CC) $(DFLAGS) $(XFLAGS) $(STATIC) -c init_race.c

list.o:	list.c
	$(CC) $(DFLAGS) $(XFLAGS) $(STATIC) -c list.c

### SYSTYPES

linux:
	make -e $(ALL) $(MFLAGS) \
	XFLAGS='' CC="gcc $(CFLAGS)" STATIC=-static

generic:
	make -e $(ALL) $(MFLAGS) \
	XFLAGS='' CC="gcc $(CFLAGS)" STATIC=-static

### RANDOM

clean:
	rm -f $(ALL) *.o core

