
# Copyright (C) 2020, 2021 Tommi Höynälänmaa

# This file is part of Theme-D-Golf.

# You can redistribute and/or modify this file under the terms of the
# GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any
# later version.

# This file 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, see https://www.gnu.org/licenses/.

.PHONY: install-complete uninstall-complete install-links uninstall-links

SUBDIRS = doc guile-code theme-d-code scripts examples

SCRPTS := meta/uninstalled-env meta/generate-intr-body \
  meta/generate-intr-interface \
  meta/generate-intr-target-module \
  meta/describe-cb-type

all-local: $(SCRPTS)

$(SCRPTS): %: %.in
	sed -e 's|@src_dir@|$(SRC_DIR)|g' $< > $@
	chmod 755 $@

install-complete : install install-links

uninstall-complete : uninstall-links uninstall

install-links:
	-rm $(bindir)/generate-intr-body
	$(LN_S) $(SCRIPT_DIR)/generate-intr-body.scm \
	  $(bindir)/generate-intr-body
	-rm $(bindir)/generate-intr-interface
	$(LN_S) $(SCRIPT_DIR)/generate-intr-interface.scm \
	  $(bindir)/generate-intr-interface
	-rm $(bindir)/generate-intr-target-module
	$(LN_S) $(SCRIPT_DIR)/generate-intr-target-module.scm \
	  $(bindir)/generate-intr-target-module
	$(LN_S) $(SCRIPT_DIR)/describe-cb-type.scm \
	  $(bindir)/describe-cb-type

uninstall-links:
	-rm $(bindir)/generate-intr-body
	-rm $(bindir)/generate-intr-interface
	-rm $(bindir)/generate-intr-target-module
	-rm $(bindir)/describe-cb-type
