[hackers] [libixp] Sync makefiles with wmii. || Kris Maglione

From: <hg_AT_suckless.org>
Date: Sun, 23 May 2010 16:51:15 +0000 (UTC)

changeset: 118:177b0a8067f3
tag: tip
user: Kris Maglione <kris_AT_suckless.org>
date: Sun May 23 12:50:06 2010 -0400
files: Makefile cmd/Makefile examples/Makefile include/Makefile lib/libixp/Makefile lib/libixp_pthread/Makefile lib/libixp_rubythread/Makefile lib/libixp_task/Makefile man/Makefile mk/common.mk mk/dir.mk mk/gcc.mk mk/hdr.mk mk/ixp.mk mk/lib.mk mk/man.mk mk/many.mk mk/one.mk mk/so.mk
description:
Sync makefiles with wmii.

diff -r d8b0d0508291 -r 177b0a8067f3 Makefile
--- a/Makefile Sun May 23 12:43:19 2010 -0400
+++ b/Makefile Sun May 23 12:50:06 2010 -0400
@@ -1,10 +1,10 @@
 ROOT=.
-include ${ROOT}/mk/hdr.mk
+include $(ROOT)/mk/hdr.mk
 
 DIRS = lib \
         cmd \
         include \
         man
 
-include ${ROOT}/mk/dir.mk
+include $(ROOT)/mk/dir.mk
 
diff -r d8b0d0508291 -r 177b0a8067f3 cmd/Makefile
--- a/cmd/Makefile Sun May 23 12:43:19 2010 -0400
+++ b/cmd/Makefile Sun May 23 12:50:06 2010 -0400
@@ -1,10 +1,10 @@
 ROOT=..
-include ${ROOT}/mk/hdr.mk
-include ${ROOT}/mk/ixp.mk
+include $(ROOT)/mk/hdr.mk
+include $(ROOT)/mk/ixp.mk
 
-LDLIBS = -L${ROOT}/lib -lixp
+LDLIBS = -L$(ROOT)/lib -lixp
 TARG = ixpc
-LIB = ${ROOT}/lib/libixp.a
+LIB = $(ROOT)/lib/libixp.a
 
-include ${ROOT}/mk/many.mk
+include $(ROOT)/mk/many.mk
 
diff -r d8b0d0508291 -r 177b0a8067f3 examples/Makefile
--- a/examples/Makefile Sun May 23 12:43:19 2010 -0400
+++ b/examples/Makefile Sun May 23 12:50:06 2010 -0400
@@ -1,10 +1,10 @@
 ROOT=..
-include ${ROOT}/mk/hdr.mk
-include ${ROOT}/mk/ixp.mk
+include $(ROOT)/mk/hdr.mk
+include $(ROOT)/mk/ixp.mk
 
-LDFLAGS += -L${ROOT}/lib -lixp
+LDFLAGS += -L$(ROOT)/lib -lixp
 TARG = ixpsrv
-LIB = ${ROOT}/lib/libixp.a
+LIB = $(ROOT)/lib/libixp.a
 
-include ${ROOT}/mk/many.mk
+include $(ROOT)/mk/many.mk
 
diff -r d8b0d0508291 -r 177b0a8067f3 include/Makefile
--- a/include/Makefile Sun May 23 12:43:19 2010 -0400
+++ b/include/Makefile Sun May 23 12:50:06 2010 -0400
@@ -1,9 +1,9 @@
 ROOT= ..
-include ${ROOT}/mk/hdr.mk
-include ${ROOT}/mk/ixp.mk
+include $(ROOT)/mk/hdr.mk
+include $(ROOT)/mk/ixp.mk
 
 HFILES = ixp.h \
          ixp_srvutil.h
 
-install: ${HFILES:.h=.install}
+install: $(HFILES:.h=.install)
 
diff -r d8b0d0508291 -r 177b0a8067f3 lib/libixp/Makefile
--- a/lib/libixp/Makefile Sun May 23 12:43:19 2010 -0400
+++ b/lib/libixp/Makefile Sun May 23 12:50:06 2010 -0400
@@ -19,5 +19,5 @@
         transport \
         util
 
-include ${ROOT}/mk/lib.mk
+include $(ROOT)/mk/lib.mk
 
diff -r d8b0d0508291 -r 177b0a8067f3 lib/libixp_pthread/Makefile
--- a/lib/libixp_pthread/Makefile Sun May 23 12:43:19 2010 -0400
+++ b/lib/libixp_pthread/Makefile Sun May 23 12:50:06 2010 -0400
@@ -1,10 +1,10 @@
 ROOT= ../..
-include ${ROOT}/mk/hdr.mk
-include ${ROOT}/mk/ixp.mk
+include $(ROOT)/mk/hdr.mk
+include $(ROOT)/mk/ixp.mk
 
 TARG = libixp_pthread
 
 OBJ = thread_pthread
 
-include ${ROOT}/mk/lib.mk
+include $(ROOT)/mk/lib.mk
 
diff -r d8b0d0508291 -r 177b0a8067f3 lib/libixp_rubythread/Makefile
--- a/lib/libixp_rubythread/Makefile Sun May 23 12:43:19 2010 -0400
+++ b/lib/libixp_rubythread/Makefile Sun May 23 12:50:06 2010 -0400
@@ -1,11 +1,11 @@
 ROOT= ../..
-include ${ROOT}/mk/hdr.mk
-include ${ROOT}/mk/ixp.mk
+include $(ROOT)/mk/hdr.mk
+include $(ROOT)/mk/ixp.mk
 
-CFLAGS += ${RUBYINC}
+CFLAGS += $(RUBYINC)
 
 TARG = libixp_rubythread
 OBJ = thread_ruby
 
-include ${ROOT}/mk/lib.mk
+include $(ROOT)/mk/lib.mk
 
diff -r d8b0d0508291 -r 177b0a8067f3 lib/libixp_task/Makefile
--- a/lib/libixp_task/Makefile Sun May 23 12:43:19 2010 -0400
+++ b/lib/libixp_task/Makefile Sun May 23 12:50:06 2010 -0400
@@ -1,11 +1,11 @@
 ROOT= ../..
-include ${ROOT}/mk/hdr.mk
-include ${ROOT}/mk/ixp.mk
+include $(ROOT)/mk/hdr.mk
+include $(ROOT)/mk/ixp.mk
 
-CFLAGS += ${TASKINC}
+CFLAGS += $(TASKINC)
 
 TARG = libixp_task
 OBJ = thread_task
 
-include ${ROOT}/mk/lib.mk
+include $(ROOT)/mk/lib.mk
 
diff -r d8b0d0508291 -r 177b0a8067f3 man/Makefile
--- a/man/Makefile Sun May 23 12:43:19 2010 -0400
+++ b/man/Makefile Sun May 23 12:50:06 2010 -0400
@@ -1,7 +1,7 @@
 ROOT=..
-include ${ROOT}/mk/hdr.mk
-include ${ROOT}/mk/ixp.mk
+include $(ROOT)/mk/hdr.mk
+include $(ROOT)/mk/ixp.mk
 
 TARG = ixpc.1
 
-include ${ROOT}/mk/man.mk
+include $(ROOT)/mk/man.mk
diff -r d8b0d0508291 -r 177b0a8067f3 mk/common.mk
--- a/mk/common.mk Sun May 23 12:43:19 2010 -0400
+++ b/mk/common.mk Sun May 23 12:50:06 2010 -0400
@@ -1,12 +1,21 @@
 all:
 
-install: all
+install: all simpleinstall
+uninstall: simpleuninstall
 
-MANDIRS=$(MAN)/man1
-mkdirs:
- for i in $(BIN) $(ETC) $(LIBDIR) $(MANDIRS) $(INCLUDE); do \
- test -d $(DESTDIR)$$i || echo MKDIR $$i; \
- mkdir -pm 0755 $(DESTDIR)$$i; \
+DOCDIR = $(DOC)
+simpleinstall:
+ for f in $(DOCS); do \
+ $(INSTALL) 0644 $$f $(DOCDIR)/$$f; \
+ done
+ for f in $(TEXT); do \
+ $(INSTALL) 0644 $$f $(DIR)/$$f; \
+ done
+ for f in $(BINARY); do \
+ $(INSTALL) -b 0644 $$f $(DIR)/$$f; \
+ done
+ for f in $(EXECS); do \
+ $(INSTALL) -b 0755 $$f $(DIR)/$$f; \
         done
 
 cleandep:
@@ -21,8 +30,5 @@
         echo CTAGS $$files $(TAGFILES) || \
         ctags $$files $(TAGFILES)
 
-DEP:=${shell if test -f .depend;then echo .depend;else echo /dev/null; fi}
-DEP!=echo /dev/null
-include $(DEP)
-
 .PHONY: all options clean dist install uninstall depend cleandep tags
+.PHONY: simpleuninstall simpleinstall
diff -r d8b0d0508291 -r 177b0a8067f3 mk/dir.mk
--- a/mk/dir.mk Sun May 23 12:43:19 2010 -0400
+++ b/mk/dir.mk Sun May 23 12:50:06 2010 -0400
@@ -1,8 +1,8 @@
 MKSUBDIR = \
         set -e; \
- targ=`echo $@ |sed 's/^d//'`; \
+ targ=$@; targ=$${targ\#d}; \
         for i in $$dirs; do \
- export BASE=$(BASE)$$i/; \
+ export $(SUBMAKE_EXPORT) BASE=$(BASE)$$i/; \
                 if [ ! -d $$i ]; then \
                         echo Skipping nonexistent directory: $$i 1>&2; \
                 else \
diff -r d8b0d0508291 -r 177b0a8067f3 mk/gcc.mk
--- a/mk/gcc.mk Sun May 23 12:43:19 2010 -0400
+++ b/mk/gcc.mk Sun May 23 12:50:06 2010 -0400
@@ -5,11 +5,10 @@
         -fno-inline \
         -fno-omit-frame-pointer \
         -fno-optimize-sibling-calls \
- -fno-unroll-loops \
- -DIXPlint
+ -fno-unroll-loops
 CFLAGS += \
         -std=c99 \
- -pedantic \
+ -pedantic-errors \
         -pipe \
         -fno-strict-aliasing \
         -Wall \
diff -r d8b0d0508291 -r 177b0a8067f3 mk/hdr.mk
--- a/mk/hdr.mk Sun May 23 12:43:19 2010 -0400
+++ b/mk/hdr.mk Sun May 23 12:50:06 2010 -0400
@@ -1,12 +1,33 @@
+DIR =
+DIRS =
+DOC =
+DOCDIR =
+DOCS =
+EXECS =
+HFILES =
+INCLUDES =
+LIB =
+LIBS =
+OBJ =
+OFILES =
+OFILES_PIC =
+PACKAGES =
+PROG =
+SO =
+TAGFILES =
+TARG =
+TEXT =
+
 FILTER = cat
 
 EXCFLAGS = $(INCLUDES) -D_XOPEN_SOURCE=600
 
-COMPILE = $(ROOT)/util/compile "$(CC)" "$(EXCFLAGS) $(CFLAGS) $$(pkg-config --cflags $(PACKAGES))"
-COMPILEPIC = $(ROOT)/util/compile "$(CC)" "$(EXCFLAGS) $(CFLAGS) $$(pkg-config --cflags $(PACKAGES)) $(SOCFLAGS)"
+COMPILE_FLAGS = $(EXCFLAGS) $(CFLAGS) $$(pkg-config --cflags $(PACKAGES))
+COMPILE = $(ROOT)/util/compile "$(CC)" "$(COMPILE_FLAGS)"
+COMPILEPIC = $(ROOT)/util/compile "$(CC)" "$(COMPILE_FLAGS) $(SOCFLAGS)"
 
-LINK = $(ROOT)/util/link "$(LD)" "$$(pkg-config --libs $(PACKAGES)) $(LDFLAGS)"
-LINKSO = $(ROOT)/util/link "$(LD)" "$$(pkg-config --libs $(PACKAGES)) $(SOLDFLAGS) $(SHARED)"
+LINK = $(ROOT)/util/link "$(LD)" "$$(pkg-config --libs $(PACKAGES)) $(LDFLAGS) $(LIBS)"
+LINKSO = $(ROOT)/util/link "$(LD)" "$$(pkg-config --libs $(PACKAGES)) $(SOLDFLAGS) $(LIBS) $(SHARED)"
 
 CLEANNAME=$(ROOT)/util/cleanname
 
@@ -17,14 +38,6 @@
 
 PACKAGES = 2>/dev/null
 
-include $(ROOT)/config.mk
-
-# I hate this.
-MKCFGSH=if test -f $(ROOT)/config.local.mk; then echo $(ROOT)/config.local.mk; else echo /dev/null; fi
-MKCFG:=${shell $(MKCFGSH)}
-MKCFG!=${MKCFGSH}
-include $(MKCFG)
-
 # and this:
 # Try to find a sane shell. /bin/sh is a last resort, because it's
 # usually bash on Linux, which means it's painfully slow.
@@ -34,13 +47,23 @@
            else echo /bin/sh; fi)
 BINSH != echo /bin/sh
 
+include $(ROOT)/config.mk
+
+# I hate this.
+MKCFGSH=if test -f $(ROOT)/config.local.mk; then echo $(ROOT)/config.local.mk; else echo /dev/null; fi
+MKCFG:=$(shell $(MKCFGSH))
+MKCFG!=$(MKCFGSH)
+include $(MKCFG)
+
 .SILENT:
 .SUFFIXES: .out .o .o_pic .c .pdf .sh .rc .$(SOEXT) .awk .1 .man1 .depend .install .uninstall .clean
 all:
 
+MAKEFILES=.depend
 .c.depend:
         echo MKDEP $<
- $(MKDEP) $(EXCFLAGS) $(CFLAGS) $< >>.depend
+ [ -n "$(noisycc)" ] && echo $(MKDEP) $(COMPILE_FLAGS) $< || true
+ eval "$(MKDEP) $(COMPILE_FLAGS)" $< >>.depend
 
 .sh.depend .rc.depend .1.depend .awk.depend:
         :
@@ -53,64 +76,68 @@
 .o.out:
         $(LINK) $@ $<
 .c.out:
- $(COMPILE) ${<:.c=.o} $<
- $(LINK) $@ ${<:.c=.o}
+ $(COMPILE) $(<:.c=.o) $<
+ $(LINK) $@ $(<:.c=.o)
 
-.sh.out:
+.rc.out .awk.out .sh.out:
         echo FILTER $(BASE)$<
- $(FILTER) $< >$@
- sh -n $@
+ [ -n "$(<:%.sh=)" ] || $(BINSH) -n $<
+ set -e; \
+ [ -n "$(noisycc)" ] && set -x; \
+ $(FILTER) $< >$@; \
         chmod 0755 $@
-.rc.out .awk.out:
- echo FILTER $(BASE)$<
- $(FILTER) $< >$@
- chmod 0755 $@
+
 .man1.1:
         echo TXT2TAGS $(BASE)$<
+ [ -n "$(noisycc)" ] && set -x; \
         txt2tags -o- $< >$@
 
+INSTALL= _install() { set -e; \
+ dashb=$$1; [ $$1 = -b ] && shift; \
+ d=$$(dirname $$3); \
+ if [ ! -d $(DESTDIR)$$d ]; then echo MKDIR $$d; mkdir -p $(DESTDIR)$$d; fi; \
+ echo INSTALL $$($(CLEANNAME) $(BASE)$$2); \
+ [ -n "$(noisycc)" ] && set -x; \
+ if [ "$$dashb" = -b ]; \
+ then cp -f $$2 $(DESTDIR)$$3; \
+ else $(FILTER) <$$2 >$(DESTDIR)$$3; \
+ fi; \
+ chmod $$1 $(DESTDIR)$$3; \
+ set +x; \
+ }; _install
+UNINSTALL= _uninstall() { set -e; \
+ echo UNINSTALL $$($(CLEANNAME) $(BASE)$$2); \
+ [ -n "$(noisycc)" ] && set -x; \
+ rm -f $(DESTDIR)$$3; \
+ }; _uninstall
+
 .out.install:
- echo INSTALL $$($(CLEANNAME) $(BASE)$*)
- cp -f $< $(DESTDIR)$(BIN)/$*
- chmod 0755 $(DESTDIR)$(BIN)/$*
+ $(INSTALL) -b 0755 $< $(BIN)/$*
 .out.uninstall:
- echo UNINSTALL $$($(CLEANNAME) $(BASE)$*)
- rm -f $(DESTDIR)$(BIN)/$*
+ $(UNINSTALL) $< $(BIN)/$*
 
 .a.install .$(SOEXT).install:
- echo INSTALL $$($(CLEANNAME) $(BASE)$<)
- cp -f $< $(DESTDIR)$(LIBDIR)/$<
- chmod 0644 $(DESTDIR)$(LIBDIR)/$<
+ $(INSTALL) -b 0644 $< $(LIBDIR)/$<
 .a.uninstall .$(SOEXT).uninstall:
- echo UNINSTALL $$($(CLEANNAME) $(BASE)$<)
- rm -f $(DESTDIR)$(LIBDIR)/$<
+ $(UNINSTALL) $< $(LIBDIR)/$<
 
 .h.install:
- echo INSTALL $$($(CLEANNAME) $(BASE)$<)
- cp -f $< $(DESTDIR)$(INCLUDE)/$<
- chmod 0644 $(DESTDIR)$(INCLUDE)/$<
+ $(INSTALL) 0644 $< $(INCLUDE)/$<
 .h.uninstall:
- echo UNINSTALL $$($(CLEANNAME) $(BASE)$<)
- rm -f $(DESTDIR)$(INCLUDE)/$<
+ $(UNINSTALL) $< $(INCLUDE)/$<
 
 .pdf.install:
- echo INSTALL $$($(CLEANNAME) $(BASE)$<)
- cp -f $< $(DESTDIR)$(DOC)/$<
- chmod 0644 $(DESTDIR)$(DOC)/$<
+ $(INSTALL) -b 0644 $< $(DOC)/$<
 .pdf.uninstall:
- echo UNINSTALL $$($(CLEANNAME) $(BASE)$<)
- rm -f $(DESTDIR)$(DOC)/$<
+ $(UNINSTALL) $< $(DOC)/$<
 
-.1.install:
- set -e; \
- man=1; \
- path="$(MAN)/man$$man/$*.$$man"; \
- echo INSTALL man $$($(CLEANNAME) "$(BASE)/$*($$man)"); \
- $(FILTER) <"$<" >$(DESTDIR)"$$path"; \
- chmod 0644 $(DESTDIR)"$$path"
-.1.uninstall:
- echo UNINSTALL man $$($(CLEANNAME) $*'(1)')
- rm -f $(DESTDIR)$(MAN)/man1/$<
+INSTALMAN= _installman() { man=$${1\#\#*.}; $(INSTALL) 0644 $$1 $(MAN)/man$$man/$$1; }; _installman
+UNINSTALLMAN=_uninstallman() { man=$${1\#\#*.}; $(UNINSTALL) $$1 $(MAN)/man$$man/$$1; }; _uninstallman
+MANSECTIONS=1 2 3 4 5 6 7 8 9
+$(MANSECTIONS:%=.%.install):
+ $(INSTALMAN) $<
+$(MANSECTIONS:%=.%.uninstall):
+ $(UNINSTALL) $<
 
 .out.clean:
         echo CLEAN $$($(CLEANNAME) $(BASE)$<)
@@ -121,9 +148,8 @@
         rm -f $< || true 2>/dev/null
 
 printinstall:
-mkdirs:
 clean:
-install: printinstall mkdirs
+install: printinstall
 depend: cleandep
 
 include $(ROOT)/mk/common.mk
diff -r d8b0d0508291 -r 177b0a8067f3 mk/ixp.mk
--- a/mk/ixp.mk Sun May 23 12:43:19 2010 -0400
+++ b/mk/ixp.mk Sun May 23 12:50:06 2010 -0400
@@ -1,5 +1,7 @@
 VERSION = 0.5
 
+COPYRIGHT = ©2010 Kris Maglione
+
 $(ROOT)/include/ixp.h: $(ROOT)/config.mk
-CFLAGS += '-DVERSION=\"$(VERSION)\"' -D_XOPEN_SOURCE=600
+CFLAGS += '-DVERSION=\"$(VERSION)\"' '-DCOPYRIGHT=\"$(COPYRIGHT)\"'
 
diff -r d8b0d0508291 -r 177b0a8067f3 mk/lib.mk
--- a/mk/lib.mk Sun May 23 12:43:19 2010 -0400
+++ b/mk/lib.mk Sun May 23 12:50:06 2010 -0400
@@ -1,13 +1,13 @@
 PTARG = $(ROOT)/lib/$(TARG)
 LIB = $(PTARG).a
-OFILES = ${OBJ:=.o}
+OFILES = $(OBJ:=.o)
 
 all: $(HFILES) $(LIB)
 
 install: $(PTARG).install
 uninstall: $(PTARG).uninstall
 clean: libclean
-depend: ${OBJ:=.depend}
+depend: $(OBJ:=.depend)
 
 libclean:
         for i in $(LIB) $(OFILES); do \
@@ -26,7 +26,7 @@
         $(AR) $@ $(OFILES)
 
 SOMKSH=case "$(MAKESO)" in 1|[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]) echo $(ROOT)/mk/so.mk;; *) echo /dev/null;; esac
-SOMK:=${shell $(SOMKSH)}
+SOMK:=$(shell $(SOMKSH))
 SOMK!=$(SOMKSH)
 include $(SOMK)
 
diff -r d8b0d0508291 -r 177b0a8067f3 mk/man.mk
--- a/mk/man.mk Sun May 23 12:43:19 2010 -0400
+++ b/mk/man.mk Sun May 23 12:50:06 2010 -0400
@@ -1,5 +1,7 @@
-install: ${TARG:.1=.install}
-uninstall: ${TARG:.1=.uninstall}
+
+all: $(TARG)
+install: $(TARG:.1=.install)
+uninstall: $(TARG:.1=.uninstall)
 
 printinstall:
         echo 'Install directories:'
diff -r d8b0d0508291 -r 177b0a8067f3 mk/many.mk
--- a/mk/many.mk Sun May 23 12:43:19 2010 -0400
+++ b/mk/many.mk Sun May 23 12:50:06 2010 -0400
@@ -1,10 +1,10 @@
-PROGS = ${TARG:=.out}
+PROGS = $(TARG:=.out)
 
 all: $(OFILES) $(PROGS)
 
-install: ${TARG:=.install}
-uninstall: ${TARG:=.uninstall}
-depend: ${OFILES:.o=.depend} ${TARG:=.depend}
+install: $(TARG:=.install)
+uninstall: $(TARG:=.uninstall)
+depend: $(OFILES:.o=.depend) $(TARG:=.depend)
 clean: manyclean
 
 printinstall:
@@ -12,7 +12,7 @@
         echo ' Bin: $(BIN)'
 
 manyclean:
- for i in ${TARG:=.o} ${TARG:=.out} $(OFILES); do \
+ for i in $(TARG:=.o) $(TARG:=.out) $(OFILES); do \
                 [ -e $$i ] && \
                 echo CLEAN $$($(CLEANNAME) $(BASE)$$i); \
                 rm -f $$i; \
diff -r d8b0d0508291 -r 177b0a8067f3 mk/one.mk
--- a/mk/one.mk Sun May 23 12:43:19 2010 -0400
+++ b/mk/one.mk Sun May 23 12:50:06 2010 -0400
@@ -1,12 +1,12 @@
 PROG = $(TARG).out
-OFILES = ${OBJ:=.o}
+OFILES = $(OBJ:=.o)
 
 all: $(PROG)
 
 install: $(TARG).install
 uninstall: $(TARG).uninstall
 clean: oneclean
-depend: ${OBJ:=.depend}
+depend: $(OBJ:=.depend)
 
 printinstall:
         echo 'Install directories:'
diff -r d8b0d0508291 -r 177b0a8067f3 mk/so.mk
--- a/mk/so.mk Sun May 23 12:43:19 2010 -0400
+++ b/mk/so.mk Sun May 23 12:50:06 2010 -0400
@@ -1,14 +1,14 @@
 SOPTARG = $(ROOT)/lib/$(TARG)
 SO = $(SOPTARG).$(SOEXT)
 SONAME = $(TARG).$(SOEXT)
-OFILES_PIC = ${OBJ:=.o_pic}
+OFILES_PIC = $(OBJ:=.o_pic)
 
 all: $(HFILES) $(SO)
 
 install: $(SOPTARG).install
 uninstall: $(SOPTARG).uninstall
 clean: soclean
-depend: ${OBJ:=.depend}
+depend: $(OBJ:=.depend)
 
 soclean:
         for i in $(SO) $(OFILES_PIC); do \
Received on Sun May 23 2010 - 16:51:15 UTC

This archive was generated by hypermail 2.2.0 : Sun May 23 2010 - 17:00:08 UTC