make: switch to POSIX make default tip

Tue, 29 Jun 2021 13:18:22 +0200

author
David Demelier <markand@malikania.fr>
date
Tue, 29 Jun 2021 13:18:22 +0200
changeset 2
b899f0dd41d2
parent 1
75cd4dd83a0e

make: switch to POSIX make

GNUmakefile file | annotate | diff | comparison | revisions
Makefile file | annotate | diff | comparison | revisions
config.mk file | annotate | diff | comparison | revisions
dmenu-ssh/Makefile file | annotate | diff | comparison | revisions
rules.mk file | annotate | diff | comparison | revisions
--- a/GNUmakefile	Mon Jun 28 15:36:12 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-#
-# GNUmakefile -- GNU make for dmenutools
-#
-# Copyright (c) 2021 David Demelier <markand@malikania.fr>
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-#
-
-PREFIX=         /usr/local
-BINDIR=         ${PREFIX}/bin
-LIBEXECDIR=     ${PREFIX}/libexec
-
-TOOLS=          dmenu-ssh/dmenu-ssh
-
-.SUFFIXES:
-.SUFFIXES: .c .o .sh
-
-all: ${TOOLS}
-
-.sh:
-	sed -e "s,@LIBEXECDIR@,${LIBEXECDIR},g" < $< > $@
-	chmod +x $@
-
-install:
-	mkdir -p ${DESTDIR}${BINDIR}
-	cp ${TOOLS} ${DESTDIR}${BINDIR}
-	mkdir -p ${DESTDIR}${LIBEXECDIR}/dmenutools
-	cp dmenu.subr ${DESTDIR}${LIBEXECDIR}/dmenutools
-
-clean:
-	rm -f ${TOOLS}
-
-.PHONY: all clean install
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Makefile	Tue Jun 29 13:18:22 2021 +0200
@@ -0,0 +1,37 @@
+#
+# Makefile -- basic makefile for dmenutools
+#
+# Copyright (c) 2021 David Demelier <markand@malikania.fr>
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+
+.POSIX:
+
+include config.mk
+
+SUBDIRS=        dmenu-ssh
+
+all:
+	for s in ${SUBDIRS}; do ${MAKE} -C $$s all; done
+
+install:
+	mkdir -p ${DESTDIR}${BINDIR}
+	mkdir -p ${DESTDIR}${LIBEXECDIR}/dmenutools
+	cp dmenu.subr ${DESTDIR}${LIBEXECDIR}/dmenutools
+	for s in ${SUBDIRS}; do ${MAKE} -C $$s install; done
+
+clean:
+	for s in ${SUBDIRS}; do ${MAKE} -C $$s clean; done
+
+.PHONY: all clean install
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/config.mk	Tue Jun 29 13:18:22 2021 +0200
@@ -0,0 +1,24 @@
+#
+# config.mk -- configuration
+#
+# Copyright (c) 2021 David Demelier <markand@malikania.fr>
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+
+CC=             cc
+CFLAGS=         -O3 -DNDEBUG
+
+PREFIX=         /usr/local
+BINDIR=         ${PREFIX}/bin
+LIBEXECDIR=     ${PREFIX}/libexec
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dmenu-ssh/Makefile	Tue Jun 29 13:18:22 2021 +0200
@@ -0,0 +1,32 @@
+#
+# Makefile -- basic makefile for dmenu-ssh
+#
+# Copyright (c) 2021 David Demelier <markand@malikania.fr>
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+
+.POSIX:
+
+include ../config.mk
+include ../rules.mk
+
+all: dmenu-ssh
+
+install:
+	cp dmenu-ssh ${DESTDIR}${BINDIR}
+
+clean:
+	rm -f dmenu-ssh
+
+.PHONY: all clean install
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rules.mk	Tue Jun 29 13:18:22 2021 +0200
@@ -0,0 +1,27 @@
+#
+# rules.mk -- general rules for dmenutools
+#
+# Copyright (c) 2021 David Demelier <markand@malikania.fr>
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+
+.SUFFIXES:
+.SUFFIXES: .c .o .sh
+
+.c.o:
+	${CC} -c $< -o $@ -MMD ${CFLAGS}
+
+.sh:
+	sed -e "s,@LIBEXECDIR@,${LIBEXECDIR},g" < $< > $@
+	chmod +x $@

mercurial