blob: 67f71bde939a64abbf66623fb36ddc82569655e4 [file] [log] [blame]
martin f. krafftd4833b32013-06-23 13:35:46 +02001#!/usr/bin/make
2#
3# This file is part of reclass (http://github.com/madduck/reclass)
4#
5# Copyright © 2007–13 martin f. krafft <madduck@madduck.net>
6# Released under the terms of the Artistic Licence 2.0
7#
8
9PYTHON_DEFAULT = /usr/bin/python
10PYTHON := $(shell which python)
11
12IN_FILES = $(wildcard *.in adapters/*.in)
13all: $(patsubst %.in,%,$(IN_FILES))
14.PHONY: all
15
16ifeq ($(PYTHON),$(PYTHON_DEFAULT))
17REPLACE_PYTHON_SHEBANG = cat
18else
19REPLACE_PYTHON_SHEBANG = sed -e 's,$(PYTHON_DEFAULT),$(PYTHON),g'
20endif
21
22%: %.in ALWAYS_REDO
23 $(REPLACE_PYTHON_SHEBANG) $< > $@
24 chmod +x $@
25
26ALWAYS_REDO:
27 @: