/*
 * $Id: Jmakefile 16228 2009-03-21 15:58:27Z rmanfredi $
 *
 * Copyright (c) 2004, Raphael Manfredi
 *
 * Jmakefile for common sources.
 *
 *----------------------------------------------------------------------
 * This file is part of gtk-gnutella.
 *
 *  gtk-gnutella 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.
 *
 *  gtk-gnutella 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 gtk-gnutella; if not, write to the Free Software
 *  Foundation, Inc.:
 *      59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *----------------------------------------------------------------------
 */

;# $Id: Jmakefile 16228 2009-03-21 15:58:27Z rmanfredi $

LSRC = \
	adns.c \
	aging.c \
	ascii.c \
	atoms.c \
	base16.c \
	base32.c \
	base64.c \
	bg.c \
	bstr.c \
	cobs.c \
	compat_pio.c \
	compat_sleep_ms.c \
	cq.c \
	crash.c \
	crc.c \
	dbmap.c \
	dbmw.c \
	dbus_util.c \
	debug.c \
	entropy.c \
	eval.c \
	event.c \
	fast_assert.c \
	fifo.c \
	file.c \
	fragcheck.c \
	fs_free_space.c \
	getdate.c \
	getline.c \
	getphysmemsize.c \
	glib-missing.c \
	gnet_host.c \
	halloc.c \
	hashlist.c \
	hashtable.c \
	header.c \
	host_addr.c \
	html.c \
	idtable.c \
	inputevt.c \
	iprange.c \
	iso3166.c \
	list.c \
	magnet.c \
	malloc.c \
	map.c \
	mime_type.c \
	misc.c \
	options.c \
	pagetable.c \
	palloc.c \
	patricia.c \
	pattern.c \
	pmsg.c \
	prop.c \
	sequence.c \
	sha1.c \
	slist.c \
	socket.c \
	sorted_array.c \
	stats.c \
	strtok.c \
	tea.c \
	tiger.c \
	tigertree.c \
	tm.c \
	url.c \
	url_factory.c \
	urn.c \
	utf8.c \
	vendors.c \
	vmm.c \
	walloc.c \
	watcher.c \
	wordvec.c \
	zalloc.c \
	zlib_util.c

/* Object files are derived from source files */
LOBJ = \
|expand f!$(LSRC)!
	!f:\.c=.o \
-expand \\

/* Additional flags for glib compilation, added in the substituted section */
++GLIB_CFLAGS $glibcflags

/* Additional flags for dbus compilation, added in the substituted section */
++DBUS_CFLAGS $dbuscflags

;# Those extra flags are expected to be user-defined
CFLAGS = -I$(TOP) -I.. $(GLIB_CFLAGS) $(DBUS_CFLAGS) -DCURDIR=$(CURRENT)
DPFLAGS = $(CFLAGS)

NormalLibraryTarget(shared,$(LSRC),$(LOBJ))
DependTarget()

/*
 * Since getdate.c is in CVS, they can compile even if they lack yacc.
 * Do that only for developpers (the ".package" file is required to be able
 * to run "metaconfig").
 */
getdate.c: getdate.y
	-@if test -f $(TOP)/.package; then \
		echo "	$(YACC) $(JYFLAGS) $<"; \
		$(YACC) $(JYFLAGS) $<; \
		echo "	$(MV) y.tab.c $@"; \
		$(MV) y.tab.c $@; else touch $@; fi

