diff options
Diffstat (limited to 'mk')
-rw-r--r-- | mk/cc.mk | 28 | ||||
-rw-r--r-- | mk/depend.mk | 11 | ||||
-rw-r--r-- | mk/dist.mk | 31 | ||||
-rw-r--r-- | mk/files.mk | 9 | ||||
-rw-r--r-- | mk/man.mk | 25 | ||||
-rw-r--r-- | mk/os-BSD.mk | 5 | ||||
-rw-r--r-- | mk/os-Darwin.mk | 5 | ||||
-rw-r--r-- | mk/os-Linux.mk | 8 | ||||
-rw-r--r-- | mk/os.mk | 7 | ||||
-rw-r--r-- | mk/prog.mk | 68 | ||||
-rw-r--r-- | mk/scripts.mk | 9 | ||||
-rw-r--r-- | mk/sys.mk | 14 |
12 files changed, 0 insertions, 220 deletions
diff --git a/mk/cc.mk b/mk/cc.mk deleted file mode 100644 index fcf0535..0000000 --- a/mk/cc.mk +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2008 Roy Marples <roy@marples.name> - -# Setup some good default CFLAGS -CFLAGS?= -Os - -# Default to using the C99 standard -CSTD?= c99 -_CSTD_SH= if test -n "${CSTD}"; then echo "-std=${CSTD}"; else echo ""; fi -_CSTD!= ${_CSTD_SH} -CFLAGS+= ${_CSTD}$(shell ${_CSTD_SH}) - -# Try and use some good cc flags if we're building from git -_CCFLAGS= -pedantic -Wall -Wunused -Wimplicit -Wshadow -Wformat=2 \ - -Wmissing-declarations -Wno-missing-prototypes -Wwrite-strings \ - -Wbad-function-cast -Wnested-externs -Wcomment -Winline \ - -Wchar-subscripts -Wcast-align -Wno-format-nonliteral \ - -Wdeclaration-after-statement -Wsequence-point -Wextra -_CC_FLAGS_SH= if ! test -d .git; then echo ""; else for f in ${_CCFLAGS}; do \ - if ${CC} $$f -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \ - then printf "%s" "$$f "; fi \ - done; fi -_CC_FLAGS!= ${_CC_FLAGS_SH} -CFLAGS+= ${_CC_FLAGS}$(shell ${_CC_FLAGS_SH}) - -_GGDB_SH= if test "${DEBUG}" = "yes"; then echo "-ggdb -DDEBUG"; else echo ""; fi -_GGDB!= ${_GGDB_SH} -GGDB= ${_GGDB}$(shell ${_GGDB_SH}) -CFLAGS+= ${GGDB} diff --git a/mk/depend.mk b/mk/depend.mk deleted file mode 100644 index a4d717a..0000000 --- a/mk/depend.mk +++ /dev/null @@ -1,11 +0,0 @@ -# This only works for make implementations that always include a .depend if -# it exists. Only GNU make does not do this. - -# Copyright 2008 Roy Marples <roy@marples.name> - -CLEANFILES+= .depend - -.depend: ${SRCS} - ${CC} ${CFLAGS} -MM ${SRCS} > .depend - -depend: .depend diff --git a/mk/dist.mk b/mk/dist.mk deleted file mode 100644 index 3d9385b..0000000 --- a/mk/dist.mk +++ /dev/null @@ -1,31 +0,0 @@ -# rules to make a distribution tarball from a git repo -# Copyright 2008 Roy Marples <roy@marples.name> - -GITREF?= HEAD -DISTPREFIX?= ${PROG}-${VERSION} -DISTFILE?= ${DISTPREFIX}.tar.bz2 - -CLEANFILES+= *.tar.bz2 - -_VERSION_SH= sed -n 's/\#define VERSION[[:space:]]*"\(.*\)".*/\1/p' config.h -_VERSION!= ${_VERSION_SH} -VERSION= ${_VERSION}$(shell ${_VERSION_SH}) - -_SNAP_SH= date -u +%Y%m%d%H%M -_SNAP!= ${_SNAP_SH} -SNAP= ${_SNAP}$(shell ${_SNAP_SH}) -SNAPDIR= ${DISTPREFIX}-${SNAP} -SNAPFILE= ${SNAPDIR}.tar.bz2 - -dist: - git archive --prefix=${DISTPREFIX}/ ${GITREF} | bzip2 > ${DISTFILE} - -snapshot: - mkdir /tmp/${SNAPDIR} - cp -RPp * /tmp/${SNAPDIR} - (cd /tmp/${SNAPDIR}; make clean) - tar -cvjpf ${SNAPFILE} -C /tmp ${SNAPDIR} - rm -rf /tmp/${SNAPDIR} - ls -l ${SNAPFILE} - -snap: snapshot diff --git a/mk/files.mk b/mk/files.mk deleted file mode 100644 index 0682b03..0000000 --- a/mk/files.mk +++ /dev/null @@ -1,9 +0,0 @@ -# Quick and dirty files -# Copyright 2008 Roy Marples <roy@marples.name> - -FILESDIR?= ${BINDIR} -FILESMODE?= ${NONBINMODE} - -_filesinstall: - ${INSTALL} -d ${DESTDIR}${FILESDIR} - ${INSTALL} -m ${FILESMODE} ${FILES} ${DESTDIR}${FILESDIR} diff --git a/mk/man.mk b/mk/man.mk deleted file mode 100644 index f1570bb..0000000 --- a/mk/man.mk +++ /dev/null @@ -1,25 +0,0 @@ -# rules to install manpages -# Copyright 2008 Roy Marples <roy@marples.name> - -_MANPREFIX_SH= if [ -n "${PREFIX}" ]; then echo "${PREFIX}"; else echo "/usr/share"; fi -_MANPREFIX!= ${_MANPREFIX_SH} -MANPREFIX?= ${_MANPREFIX}$(shell ${_MANPREFIX_SH}) - -MANDIR?= ${MANPREFIX}/man/man -MANMODE?= 0444 - -_MAN5_SH= for man in ${MAN}; do case $$man in *.5) echo $$man;; esac; done -_MAN5!= ${_MAN5_SH} -MAN5= ${_MAN5}$(shell ${_MAN5_SH}) - -_MAN8_SH= for man in ${MAN}; do case $$man in *.8) echo $$man;; esac; done -_MAN8!= ${_MAN8_SH} -MAN8= ${_MAN8}$(shell ${_MAN8_SH}) - -_man: ${MAN} - -_maninstall: _man - ${INSTALL} -d ${DESTDIR}${MANDIR}5 - ${INSTALL} -m ${MANMODE} ${MAN5} ${DESTDIR}${MANDIR}5 - ${INSTALL} -d ${DESTDIR}${MANDIR}8 - ${INSTALL} -m ${MANMODE} ${MAN8} ${DESTDIR}${MANDIR}8 diff --git a/mk/os-BSD.mk b/mk/os-BSD.mk deleted file mode 100644 index f9d3397..0000000 --- a/mk/os-BSD.mk +++ /dev/null @@ -1,5 +0,0 @@ -# Setup OS specific variables -# Copyright 2008 Roy Marples <roy@marples.name> - -SRC_PF= bpf.c -SRC_IF= if-bsd.c diff --git a/mk/os-Darwin.mk b/mk/os-Darwin.mk deleted file mode 100644 index f2c3104..0000000 --- a/mk/os-Darwin.mk +++ /dev/null @@ -1,5 +0,0 @@ -# Setup OS specific variables -# Copyright 2008 Roy Marples <roy@marples.name> - -include ${MK}/os-BSD.mk -LINK_RPATH= --rpath diff --git a/mk/os-Linux.mk b/mk/os-Linux.mk deleted file mode 100644 index 2d316b1..0000000 --- a/mk/os-Linux.mk +++ /dev/null @@ -1,8 +0,0 @@ -# Setup OS specific variables -# Copyright 2008 Roy Marples <roy@marples.name> - -SRC_PF= lpf.c -SRC_IF= if-linux.c - -CPPFLAGS+= -D_BSD_SOURCE -D_XOPEN_SOURCE=600 -LIBRT= -lrt diff --git a/mk/os.mk b/mk/os.mk deleted file mode 100644 index f3426e4..0000000 --- a/mk/os.mk +++ /dev/null @@ -1,7 +0,0 @@ -# Setup OS specific variables -# Copyright 2008 Roy Marples <roy@marples.name> - -_OS_SH= case `uname -s` in Linux) echo "Linux";; Darwin) echo "Darwin";; *) echo "BSD";; esac -_OS!= ${_OS_SH} -OS= ${_OS}$(shell ${_OS_SH}) -include ${MK}/os-${OS}.mk diff --git a/mk/prog.mk b/mk/prog.mk deleted file mode 100644 index d970b2d..0000000 --- a/mk/prog.mk +++ /dev/null @@ -1,68 +0,0 @@ -# rules to build a program -# based on FreeBSD's bsd.prog.mk - -# Copyright 2008 Roy Marples <roy@marples.name> - -include ${MK}/cc.mk - -OBJS+= ${SRCS:.c=.o} - -# If building for /, ensure we use the libc in / if different from -# the default one in /usr/lib -LINK_RPATH?= -Wl,-rpath -_RPATH_SH= if test "${PREFIX}" = "" -o "${PREIX}" = "/"; then \ - echo "${LINK_RPATH}=${PREFIX}/${LIBNAME}"; \ - else \ - echo ""; \ - fi -_RPATH!= ${_RPATH_SH} -LDFLAGS+= ${_RPATH}$(shell ${_RPATH_SH}) - -# If building for /, ensure we use the linker in /libexec if different from -# the default one in /usr/libexec -_DYNLINK_SH= if test "${PREFIX}" = "" -o "${PREFIX}" = "/" && test -e /libexec/ld.elf_so; then \ - echo "-Wl,-dynamic-linker=/libexec/ld.elf_so"; \ - else \ - echo ""; \ - fi -_DYNLINK!= ${_DYNLINK_SH} -LDFLAGS+= ${_DYNLINK}$(shell ${_DYNLINK_SH}) - -all: ${PROG} ${SCRIPTS} _man - -.c.o: - ${CC} ${CFLAGS} ${CPPFLAGS} -c $< -o $@ - -${PROG}: ${OBJS} - ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LDADD} - -# We could save about 600 bytes by building it like this -# instead of the more traditional method above -small: ${SRCS} - echo "" > _${PROG}.c - for src in ${SRCS}; do echo "#include \"$$src\"" >> _${PROG}.c; done - ${CC} ${CFLAGS} ${CPPFLAGS} -c _${PROG}.c -o _${PROG}.o - ${CC} ${LDFLAGS} -o ${PROG} _${PROG}.o ${LDADD} - -_proginstall: ${PROG} - ${INSTALL} -d ${DESTDIR}${BINDIR} - ${INSTALL} -m ${BINMODE} ${PROG} ${DESTDIR}${BINDIR} - ${INSTALL} -d ${DESTDIR}${DBDIR} - -include ${MK}/depend.mk -include ${MK}/files.mk -include ${MK}/scripts.mk -include ${MK}/man.mk -include ${MK}/dist.mk - -install: _proginstall _scriptsinstall _filesinstall _maninstall - for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@; cd ..; done - -clean: - rm -f ${OBJS} ${PROG} _${PROG}.c _${PROG}.o ${PROG}.core ${CLEANFILES} - -LINTFLAGS?= -hx -LINTFLAGS+= -X 159,247,352 - -lint: ${SRCS:.c=.c} - ${LINT} ${LINTFLAGS} ${CFLAGS:M-[DIU]*} $^ ${.ALLSRC} diff --git a/mk/scripts.mk b/mk/scripts.mk deleted file mode 100644 index d295163..0000000 --- a/mk/scripts.mk +++ /dev/null @@ -1,9 +0,0 @@ -# Quick and dirty scripts -# Copyright 2008 Roy Marples <roy@marples.name> - -SCRIPTSDIR?= ${BINDIR} -SCRIPTSMODE?= ${BINMODE} - -_scriptsinstall: ${SCRIPTS} - ${INSTALL} -d ${DESTDIR}${SCRIPTSDIR} - ${INSTALL} -m ${SCRIPTSMODE} ${SCRIPTS} ${DESTDIR}${SCRIPTSDIR} diff --git a/mk/sys.mk b/mk/sys.mk deleted file mode 100644 index 81882ab..0000000 --- a/mk/sys.mk +++ /dev/null @@ -1,14 +0,0 @@ -# Simple defaults - -BINDIR?= ${PREFIX}/usr/bin -BINMODE?= 0755 -NONBINMODE?= 0644 - -SYSCONFDIR?= ${PREFIX}/etc - -INSTALL?= install -SED?= sed - -_LIBNAME_SH= case `readlink /lib` in "") echo "lib";; *) basename `readlink /lib`;; esac -_LIBNAME!= ${_LIBNAME_SH} -LIBNAME?= ${_LIBNAME}$(shell ${_LIBNAME_SH}) |