gen-makefile (925B)
1 #!/bin/sh 2 # Generate texts for Makefile, from .local/src/* builds: 3 # 4 # generate-builds.sh >> Makefile 5 # 6 unset DIRS TEXT 7 for d in .local/src/*; do 8 base=$(basename "$d") 9 if [ -z "$TEXT" ]; then 10 DIRS="$base" 11 TEXT="$base: ## Install my build of $base 12 \$(MKDIR) \${HOME}/.local/src 13 rm -rf \${HOME}/.local/src/$base 14 cp -rf \${PWD}/.local/src/$base \${HOME}/.local/src/$base 15 cd \${HOME}/.local/src/$base; \$(RUN_PERM) make install" 16 else 17 DIRS="$DIRS $base" 18 TEXT="$TEXT 19 20 $base: ## Install my build of $base 21 \$(MKDIR) \${HOME}/.local/src 22 rm -rf \${HOME}/.local/src/$base 23 cp -rf \${PWD}/.local/src/$base \${HOME}/.local/src/$base 24 cd \${HOME}/.local/src/$base; \$(RUN_PERM) make install" 25 fi 26 done 27 28 DIRS_slash=$(echo "$DIRS" | sed 's/ /\//g') 29 30 LAST="desktop: $DIRS ## Install my suckless desktop suite ($DIRS_slash)" 31 32 printf "%s\n\ndesktop: %s ## Install my suckless desktop suite (%s)\n" "$TEXT" "$DIRS" "$DIRS_slash"