# $Id: Makefile,v 1.16 2003/02/01 05:43:04 chalky Exp $
#
# This source file is a part of the Synopsis Project
# Copyright (C) 2000 Stefan Seefeld
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library 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
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the
# Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
# MA 02139, USA.

SHELL	= /bin/sh

ifeq (,$(findstring $(MAKECMDGOALS), clean distclean))
ifeq (,$(findstring $(action), clean distclean))
include ../../../local.mk
endif
endif

SRC	:= __init__.py __init__.pyc emul.py emul.pyc occ.$(LIBRARY_EXT) link.$(LIBRARY_EXT)

# Note gc, ucpp and occ are both handled inside syn/Makefile
subdirs	:= syn

all:
	@for dir in ${subdirs}; do \
	   (cd $$dir && $(MAKE)) \
	    || case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \
	done && test -z "$$fail"; \

clean:
	/bin/rm -f *~ *.pyc *.pyo regression/*.pyc
	@for dir in gc ${subdirs}; do \
	  (cd $$dir && $(MAKE) clean) \
	  || case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \
	done && test -z "$$fail"

distclean: clean
	/bin/rm -f *.pyc *.pyo
	@for dir in gc ${subdirs}; do \
	  (cd $$dir && $(MAKE) distclean) \
	  || case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \
	done && test -z "$$fail"

install:
	mkdir -p $(packagedir)/Synopsis/Parser/C++
	install -m 644 $(SRC) $(packagedir)/Synopsis/Parser/C++
