diff options
author | 2021-04-08 13:53:28 +0200 | |
---|---|---|
committer | 2021-04-08 13:53:28 +0200 | |
commit | f3e4e9d3047f18bd1c31f04d8eb9867600d7cbd9 (patch) | |
tree | 38326ec49baf2abe2c9323f7d32f97c1d7634c96 | |
parent | 847f67c0057e870df68fc0a69af8679d3d7fe19c (diff) | |
download | acme-scripts-f3e4e9d3047f18bd1c31f04d8eb9867600d7cbd9.tar.gz acme-scripts-f3e4e9d3047f18bd1c31f04d8eb9867600d7cbd9.zip |
Enhance Makefile
-rw-r--r-- | Makefile | 27 |
1 files changed, 20 insertions, 7 deletions
@@ -1,10 +1,23 @@ -all: - echo "Usage: make install" +INSTALL_DIR=~/bin/acme +BUILD_DIR=build -install: uninstall - chmod +x *sh - find `pwd` -type f -name "*.sh" -exec ln -s {} ~/bin/acme/ ';' - find ~/bin/acme/ -type l -name "*.sh" -exec renamex -s/.sh// '{}' \; +.SUFFIXES: .sh .o + +SOURCES!=ls *.sh +OBJECTS=${SOURCES:.sh=} +D!=echo $(OBJECTS) | sed "s|^|$(INSTALL_DIR)/|g" | sed "s| | $(INSTALL_DIR)/|g" + +.sh: + chmod +x ${.IMPSRC} + ln -s ${.CURDIR}/${.IMPSRC} ${.TARGET} + +build: $(OBJECTS) + +clean: + find ${.CURDIR} -type l -exec rm -f '{}' \; + +install: build + find ${.CURDIR} -type l -exec cp -R -P '{}' ${INSTALL_DIR}/ \; uninstall: - rm -f ~/bin/acme/* + rm -f $(D) |