# Copyright 2004
# Free Software Foundation, Inc.
# This Makefile is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.

CC=gcc
RM=rm -f
CP=cp
MV=mv
CCDEPEND=-MM
CFLAGS=-Wall -Werror -ansi -pedantic-errors -DVERSION=\"$(VERSION)\" -DSHAREDIR=\"$(SHAREDIR)\" $(shell trish2-config --cflags) $(shell xml2-config --cflags) $(shell xslt-config --cflags)
CFLAGS_DEBUG=#-DMOUCHARD -g
CLIBS=-lpopt $(shell trish2-config --clibs) $(shell xml2-config --libs) $(shell xslt-config --libs)

CSRC=verbosity.c
MAINCSRC=AlvisSemTag.c
LIBTARGET=
EXEC=$(MAINCSRC:.c=)

all: $(EXEC) $(LIBTARGET)

%: %.o  $(CSRC:.c=.o)
	$(CC) -o $@ $^ $(CLIBS) $(CFLAGS_DEBUG)

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

include .depend
.depend: $(CSRC) $(MAINCSRC) $(CSRC:.c=.h)
	$(CC) $(CFLAGS) -MM -MG $(CSRC) $(MAINCSRC) > $@

.PHONY: tidy clean
tidy:
	$(RM) core.*

clean: tidy
	$(RM) $(CSRC:.c=.o)
	$(RM) $(MAINCSRC:.c=.o)

realclean: clean
	$(RM) $(EXEC)
	$(RM) $(LIBTARGET)
	$(RM) .depend
