# Makefile for GNU Robots `src' directory
# Copyright (C) 1998 Jim Hall, jhall1@isd.net

# macros:

SOURCES=api.c sign.c loadmap.c drawmap.c random.c
OBJECTS=$(SOURCES:.c=.o)


# targets:

all: robots_logfile robots xrobots

# the plain text file version:
robots_logfile: main.o ../lib/text.o $(OBJECTS)
	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ main.o ../lib/text.o $(OBJECTS) $(LDLIBS)

# the curses-mode version:
robots: main.o ../lib/curses.o $(OBJECTS)
	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ main.o ../lib/curses.o $(OBJECTS) $(LDLIBS) -lncurses

xrobots: main.o ../lib/x11.o $(OBJECTS)
	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ main.o ../lib/x11.o $(OBJECTS) $(LDLIBS) -L/usr/X11R6/lib -lX11 -lXpm


lint: $(SOURCES)
	$(LINT) $(CFLAGS) $(SOURCES)

test: all
	./robots


# clean up:

clean:
	$(RM) *~ core

realclean: clean
	$(RM) $(OBJECTS) main.o

distclean: realclean
	$(RM) robots_logfile robots xrobots
