jw-pkg/make/std-tools.mk
Jan Lindemann f19831245f make: Support GNUmakefile too, where applicable
Add support for GNUmakefile, where originally only Makefile was supported.
Not done everywhere, as some of the code involving makefiles is dead
anyway.

Signed-off-by: Jan Lindemann <jan@janware.com>
2018-12-27 17:30:10 +00:00

35 lines
960 B
Makefile

include $(MODDIR)/make/defs.mk
PROFILE_SH = profile-$(PROJECT).sh
all: $(PROFILE_SH)
clean: clean.std-tools
install: $(PROFILE_SH) install.std-tools.done
distclean: clean
$(PROFILE_SH): $(LOCAL_MKFILES)
echo '#!/bin/sh' > $@.tmp
echo "if [ \"\$$PATH\" ]; then" >> $@.tmp
echo " PATH=\$$PATH:$(INSTALL_EXEDIR)" >> $@.tmp
echo "else" >> $@.tmp
echo " PATH=$(INSTALL_EXEDIR)" >> $@.tmp
echo "fi" >> $@.tmp
echo "if [ \"\$$LD_LIBRARY_PATH\" ]; then" >> $@.tmp
echo " LD_LIBRARY_PATH=\$$LD_LIBRARY_PATH:$(INSTALL_LIBDIR)" >> $@.tmp
echo "else" >> $@.tmp
echo " LD_LIBRARY_PATH=$(INSTALL_LIBDIR)" >> $@.tmp
echo "fi" >> $@.tmp
echo "export PATH LD_LIBRARY_PATH" >> $@.tmp
mv $@.tmp $@
clean.std-tools:
$(RM) -f $(PROFILE_SH) *.done
install.std-tools.done: install.std-dir.done
$(INSTALL) -p -o $(PROFILEOWNER) -g $(PROFILEGROUP) -m $(PROFILEMODE) $(PROFILE_SH) $(PROFILE_DIR)
touch $@
install.std-dir.done:
mkdir -p $(PROFILE_DIR)
touch $@