# Fungimol - an extensible system for designing atomic-scale objects.
# Copyright (C) 2000 Tim Freeman
#
# 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 in the file COPYING.txt; if not,
# write to the Free Software Foundation, Inc., 59 Temple Place -
# Suite 330, Boston, MA 02111-1307, USA
#
# The author can be reached by email at tim@fungible.com, or by
# paper mail at:
#
# Tim Freeman
# 381 North Fernwood Circle
# Sunnyvale, CA 94085-3059
#

.PHONY: all
all:
	-rm -f *.h
	@# Both brennerc and fungimol have copies of myassert.h,
	@# so we have to omit brennerc to have a successful compile.
	ln -s $(shell find .. -name "*.h" '!' -path '*/brennerc/*' \
			 '!' -path '*/include/*') .
,PHONY:clean
clean:
	-rm -f *.h
.PHONY:install uninstall
ifeq ($(INSTALL),)
   -include stopNOINSTALL
   .PHONY:stopNOINSTALL
   stopNOINSTALL:
	@echo INSTALL should be set before invoking this Makefile.
	@exit 1
endif
ifeq ($(INCLUDEHOME),)
   -include stopNOINCLUDEHOME
   .PHONY:stopNOINCLUDEHOME
   stopNOINSTALL:
	@echo INCLUDEHOME should be set before invoking this Makefile.
	@exit 1
endif

install:
	$(INSTALL) 0755 -d $(INCLUDEHOME)
	$(INSTALL) 0444 *.h $(INCLUDEHOME)

# Note that if I said "rm -rf $(INCLUDEHOME)/." instead, and
# INCLUDEHOME were not set, then we'd do a "rm -rf /.", which is
# bad.  This version gets an error if INCLUDEHOME is not set, which
# is better. 
uninstall:
	-rm -rf $(INCLUDEHOME)
