#
# DO NOT EDIT- ../system.mk file should set everything up
# See specifically X11LIB and X11INCLUDE
#
CONFIG = system.mk

include ../$(CONFIG)

#CC = cc

LOCAL_DEFINES =

TARGET = xsg

HEADERS = 		Wlib.h bitmaps.h copyright.h copyright2.h data.h \
			defs.h oldbitmaps.h patchlevel.h struct.h version.h \
			localdata.h

SRCS =	colors.c ../ntserv/data.c defaults.c dmessage.c ../ntserv/getship.c \
	inform.c input.c main.c modify.c newwin.c option.c planetlist.c \
	planets.c playerlist.c redraw.c robotwin.c shmem.c sintab.c \
	smessage.c stats.c util.c war.c warning.c x11window.c localdata.c \
	../ntserv/getpath.c ../ntserv/distress.c ../ntserv/slotmaint.c \
	../ntserv/ltd_stats.c

OBJS =	colors.o data.o defaults.o dmessage.o ../ntserv/getship.o inform.o \
	input.o main.o modify.o newwin.o option.o planetlist.o planets.o \
	playerlist.o redraw.o robotwin.o shmem.o sintab.o smessage.o stats.o \
	util.o war.o warning.o x11window.o localdata.o ../ntserv/getpath.o \
	../ntserv/distress.o ../ntserv/slotmaint.o ../ntserv/ltd_stats.o

LIBS = $(X11LIB) $(EXTRALIBS) -lm
INCS = $(EXTRAINCS) $(X11INCLUDE)

# for people with braindead 'cc's that don't like -c foo.c -o foo.o
# and a hosed make
.c.o: ; $(CC) $(CFLAGS) $(INCS) -c $*.c

CFLAGS = $(EXTRACFLAGS) $(OPTS) $(LOCAL_DEFINES) $(FLAGS) $(DIRS)

all: xsg

xsg: $(OBJS)
	$(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS)

# data.c has an ifdef XSG in it, it must be recompiled here.

data.o:	../ntserv/data.c
	$(CC) $(CFLAGS) $(INCS) -c ../ntserv/data.c

clean:
	/bin/rm -f *.o make.out core
        
reallyclean:  clean 
	/bin/rm -f xsg #* *~

install: xsg
	$(INSTALL) $(INSTALLOPTS) xsg $(LIBDIR)/xsg

uninstall:
	-cd $(LIBDIR); rm -f xsg 

dist: ../name
	tar cvf - `cat Manifest` | gzip - > xsg2.1-`../name`.tar.gz

rmdependencies:
	makedepend

depend::
	touch .depend
	makedepend -f.depend $(CFLAGS) $(INCS) $(SRCS) 

sinclude .depend
# DO NOT DELETE
