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


# where is Guile installed?

GUILE=$(HOME)
#GUILE=/usr/local


# Un-comment this line to turn _off_ debugging messages:
# Comment this line out to turn _on_ debugging messages:

DEBUG=-DNO_DEBUG_MSGS


# macros:

CC=gcc
CFLAGS=$(DEBUG) -Wall -I../include -I$(GUILE)/include/guile -I$(GUILE)/include

LDFLAGS=-L$(GUILE)/lib
LDLIBS=-lguile -lm

LINT=lint
RM=rm -f


# targets:

all:
	(cd lib; $(MAKE) "CC=$(CC)" "CFLAGS=$(CFLAGS)" $@)
	(cd src; $(MAKE) "CC=$(CC)" "CFLAGS=$(CFLAGS)" \
	  "LDFLAGS=$(LDFLAGS)" "LDLIBS=$(LDLIBS)" $@)

lint:
	(cd lib; $(MAKE) "LINT=$(LINT)" "CFLAGS=$(CFLAGS)" $@)
	(cd src; $(MAKE) "LINT=$(LINT)" "CFLAGS=$(CFLAGS)" $@)

test: all
	(cd src; $(MAKE) $@)


# clean up:

clean:
	$(RM) *~ core

realclean: clean
	$(RM) *.o

distclean: realclean
	(cd lib; $(MAKE) "RM=$(RM)" $@)
	(cd src; $(MAKE) "RM=$(RM)" $@)
