INC = ../../include/

CC = gcc
DEBUG    = -g -O2 -mpentium 

WFLAGS   = -Wall -W -Wmissing-prototypes -Wshadow -Wcast-align \
   -Wpointer-arith -Winline -Wconversion -Wmissing-declarations  
DEFINES  = -D__ST_MT_ERRNO__ -Zmt 
INCLUDE  = -I. -I../../include -I$(X11ROOT)/XFree86/include
CFLAGS  = $(DEFINES) $(DEBUG) $(WFLAGS) $(INCLUDE)

AR     = ar rc
EMXOMF = emxomf
RANLIB = ar s
RM     = rm -f

SRCS = rand48.c random.c heapsort.c radixsort.c rev.c daemon.c 
OBJS = $(SRCS:.c=.o)

all: $(OBJS) rand48.a rand48.lib 

rand48.a: rand48.o
	$(RM) $@
	$(AR) $@ $^
	$(RANLIB) $@
	
rand48.lib: rand48.a
	$(EMXOMF) -l -s -o $@ $<

$(OBJS): $(INC)stdlibx.h $(INC)sys/errnox.h 
rev.o: ../../rev.h
clean:
	$(RM) *.a *.lib *.o
