# Generated automatically from Makefile.in by configure.
# Makefile.in - XPCommon makefile
# Copyright (c) 2000 Rex Feany (laeos@xaric.org)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# %W%
#

.DELETE_ON_ERROR:

srcdir = .
top_srcdir = .
prefix = /usr/local
exec_prefix = ${prefix}


# Programs
SHTOOL	:= $(srcdir)/shtool
RM	:= rm -f
SED	:= sed
SHELL	:= /bin/sh
CC 	:= gcc
CFLAGS 	:=  -D_GNU_SOURCE -pipe -DHAVE_CONFIG_H -Iinclude
CPP 	:= gcc -E
LDFLAGS := 
LIBS	:= 
RANLIB  := ranlib

ACLOCAL    := aclocal
AUTOCONF   := autoconf
AUTOHEADER := autoheader

XPLIB      := libxpcommon.a

SRC := 
OBJ :=
BIN :=
PBJ :=
PRC :=

all: allagain

# Each subdir has a makefile fragment with interesting stuff
# we want the data, see.
REALLY_INCLUDE := 1

include net/Makefile
include tst/Makefile
include xp/Makefile

# dependancy information
-include .depend

# Figure out what to build
OBJ += $(SRC:.c=.o)
PBJ += $(PRC:.c=.o)

allagain: $(XPLIB)

$(XPLIB): Makefile $(OBJ)
	$(SHTOOL) arx rc $(XPLIB) $(OBJ)
	$(RANLIB) $(XPLIB)

bins: $(BIN)

# rebuild makefile and configure
${srcdir}/configure: configure.in aclocal.m4 acinclude.m4
	cd ${srcdir} && $(AUTOCONF)

${srcdir}/include/config.h.in: ${srcdir}/include/stamp-h.in

${srcdir}/include/stamp-h.in: configure.in aclocal.m4 acinclude.m4 acconfig.h include/config.h.in
	cd ${srcdir} && autoheader
	echo timestamp > ${srcdir}/include/stamp-h.in

config.h: stamp-h
stamp-h: config.h.in config.status
	./config.status

Makefile: Makefile.in config.status
	./config.status

config.status: configure
	./config.status --recheck

dep: $(SRC) $(PRC)
	$(CC) $(CFLAGS) $(INCLUDES) -MM $(SRC) $(PRC) | $(SED) -e "s/\(^[^: ]\+\): \([^. ]\+\).c/\2.o: \2.c/"  > .depend

install:
	@echo "Sorry, nothing to install."

clean:
	$(RM) $(OBJ) $(PBJ)

distclean: clean
	$(RM) Makefile config.status config.log config.h .depend stamp-h
	$(RM) config.cache $(XPLIB) $(BIN)

mtclean: distclean
	$(RM) aclocal.m4 configure config.h.in

release:
	cd xp && ../$(SHTOOL) version -lc -n XPCommon -p xp_ -iv xp_version.c
revision:
	cd xp && ../$(SHTOOL) version -lc -n XPCommon -p xp_ -ir xp_version.c
patch:
	cd xp && ../$(SHTOOL) version -lc -n XPCommon -p xp_ -il xp_version.c

.c.o:
	$(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<

