Re: Add a Makefile.user on /usr/src and /usr/ports

2002-06-07 Thread Cyrille Lefevre

On Fri, Jun 07, 2002 at 12:25:09AM +0200, Riccardo Torrini wrote:
 To support fancy user and they own targets would be nice an
 infrastructure that check and (if it exist) include a file
 (named Makefile.user or .local or similar) with personal
 targets either under /usr/src than /usr/ports.
 
 This can save a lot of typing building various things (for
 example timing build phase or saving logs) only migrating
 this file from a machine to another.

maybe the attached Makefile may help you in the process.
I use it for months to build everything.

Cyrille.
-- 
Cyrille Lefevre mailto:[EMAIL PROTECTED]


#!/usr/bin/make -f
#
# @(#) etc:Makefile 1.6 ([EMAIL PROTECTED]) Wed Jun  5 23:08:17 CEST 2002
#
# Copyright (c) 2000-2002 Cyrille Lefevre. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#notice, this list of conditions and the following disclaimer in the
#documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY _DIRECT, IN_DIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.

# TODO : rel target and maybe dump target
# make release RELEASETAG=RELENG_4 CHROOT_DIR=/disk1/release/root \
# LOCAL_PATCHES=/disk1/release/patches LOCAL_SCRIPT=/disk1/release/script \
# NOPORTS=YES NODOC=YES NOSRC=YES # NOSHARED=YES RELEASENOUPDATE=YES
# ftp://current.jp.FreeBSD.org/pub/FreeBSD/snapshots/i386/ISO-IMAGES/

.MAKEARGS: .dl

# Custom
#

NCVS?=  true
RELENG?=-r RELENG_4
CUSTOM?=CUSTOM
GENERIC?=   GENERIC
DEBUG?= -g
JOBS?=  -j4
NOJOBS?=-B
# NOEXEC?=  -n
AT?=@
FORCE_LBA?= # --force-lba # - CHS ?

# Commands
#

CHFLAGS?=   chflags
CONFIG?=config
CP?=cp
CPIO?=  cpio
CVS?=   cvs
CVS_ARGS?=
CAP_MKDB?=  cap_mkdb
DATE?=  date
DISKLABEL?= disklabel
DISKLABEL_ARGS?=-wB
DISKLABEL_TYPE?=fd1440
ECHO?=  echo
FIND?=  find
GREP?=  grep
GREP_ARGS?= -B 2
GRUB?=  grub
GRUB?=  --batch
GRUB_INSTALL?=  grub-install
GRUB_INSTALL_ARGS?= ${FORCE_LBA}
KGZIP?= kgzip
MAKE?=  make
MAKE_ARGS?=
MAKEDEV?=   MAKEDEV
MAKEDEV_ARGS?=  all
MAKEDEV_LOCAL?= MAKEDEV.local
MAKEDEV_LOCAL_ARGS?=all
MERGEMASTER?=   mergemaster
MERGEMASTER_ARGS?=  -svia -vir # -s
MK_DIR?=mkdir -p
MOUNT?= mount
MV?=mv
NEWALIASES?=newaliases
NEWFS?= newfs
NEWFS_ARGS?=-m 5 -o space
PKGDB?= pkgdb
PKGDB_ARGS?=-u
PORTSDB?=   portsdb
PORTSDB_ARGS?=  -u
PWD_MKDB?=  pwd_mkdb
RM?=rm
SLEEP?= sleep
SH?=sh
TEE?=   tee
TEE_ARGS?=
TR?=tr
TOUCH?= touch
UMOUNT?=umount
ZZZ?=   zzz

# Directories
#

OBJ_DIR?=   /usr/obj
SRC_DIR?=   /usr/src
SHDOC_DIR?= ${SRC_DIR}/share/doc
SYSINSTALL_DIR?=${SRC_DIR}/release/sysinstall
KERNCONF_DIR?=  ${SRC_DIR}/sys/${MACHINE_ARCH}/conf
KERNBUILD_DIR?= ${SRC_DIR}/sys/compile
KERNMOD_DIR?=   ${SRC_DIR}/sys/modules
DEV_DIR?=   /dev
MAIL_DIR?=  /etc/mail
DOC_DIR?=   /usr/doc
DOC_ARGS?=  Makefile README share ${DOC_LANG}
WEB_DIR?=   /usr/www
WEB_ARGS?=  www/Makefile www/Makefile.inc www/share www/tools www/en
PORTS_DIR?= /usr/ports

# Files
#

KERNEL?=kernel
LOGIN_CONF?=/etc/login.conf
MASTER_PASSWD?= /etc/master.passwd
FSTAB?= /etc/fstab

# Boot
#

BOOT_DIR?=  /boot
GRUB_DIR?=  ${BOOT_DIR}/grub
ALTBOOT_DEV?=   /dev/ad0s3
ALTBOOT_DIR?=   /grub
FLOP_DEV?=  /dev/fd0
FLOP_DIR?=  /flop
BOOT_FILES?=boot0 mbr \
${FLOP_FILES:N*.map:Nstage*} ${SPLASH_FILES:%=splash/%}
FLOP_FILES?=boot[12] defaults/loader.conf \
grub/device.map grub/menu.lst ${GRUB_FILES:N*1_5:%=grub/%} \
loader loader.4th loader.help loader.rc support.4th \
kernel.conf loader.conf loader.conf.local
# GRUBXXX?= 

Add a Makefile.user on /usr/src and /usr/ports

2002-06-06 Thread Riccardo Torrini

To support fancy user and they own targets would be nice an
infrastructure that check and (if it exist) include a file
(named Makefile.user or .local or similar) with personal
targets either under /usr/src than /usr/ports.

This can save a lot of typing building various things (for
example timing build phase or saving logs) only migrating
this file from a machine to another.

I was able to patch /usr/src/Makefile and /usr/ports/Makefile
myself, any comment will be appreciated (even negative ones).


TIA,
Riccardo.


-[ /usr/src ]-

# diff -u Makefile.orig Makefile
--- Makefile.orig   Mon Jun  3 21:33:16 2002
+++ MakefileFri Jun  7 00:21:16 2002
@@ -108,6 +108,10 @@
 PATH=  /sbin:/bin:/usr/sbin:/usr/bin
 MAKE=  PATH=${PATH} make -m ${.CURDIR}/share/mk -f Makefile.inc1
 
+.if exists(${.CURDIR}/Makefile.user)
+.include ${.CURDIR}/Makefile.user
+.endif
+
 #
 # Handle the user-driven targets, using the source relative mk files.
 #


-[ /usr/ports ]-

# diff -u Makefile.orig Makefile
--- Makefile.orig   Mon Dec 31 02:29:06 2001
+++ MakefileFri Jun  7 00:12:14 2002
@@ -55,6 +55,9 @@
 PORTSTOP=  yes
 
 .include bsd.port.subdir.mk
+.if exists(${.CURDIR}/Makefile.user)
+.include ${.CURDIR}/Makefile.user
+.endif
 
 index:
@rm -f ${.CURDIR}/INDEX

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message