# The directory and filename of the default menu.
MENUFILE = /home/guest/guest.menu

# Directory to install everything to
BINDIR = /usr/local/bin

INSTALL = install
BINFLAGS = -m 755 -s

RM = rm -f

CC = gcc
LD = ld

# Edit the OPT flags to suit your system, these are for a 486 running gcc-2.6.x
OPT = -O3 -m486

# Debug is for debugging purposes (duh)
# DEBUG = -g -DDEBUG
CFLAGS = $(OPT) -Wall $(DEBUG)

LDFLAGS = -s
LIBRARIES = -lncurses

SOURCES = main.c parse.c string.c screen.c misc.c

OBJECTS = main.o parse.o string.o screen.o misc.o

.c.o:
		$(CC) $(CFLAGS) -c	-o $*.o $<

guest:		$(OBJECTS)
		$(RM) $@
		$(CC) -o $@ $(OBJECTS) $(LDFLAGS) $(LIBRARIES)

install:
		$(INSTALL) $(BINFLAGS) guest $(BINDIR)/guest

clean:
		$(RM) guest $(OBJECTS)

depend:		dep

dep:
		$(CC) -E -M $(SOURCES) > .depend

ifeq (.depend,$(wildcard .depend))
include .depend
endif
