diff options
author | Gordon Ross <gordon.w.ross@gmail.com> | 2016-10-09 21:03:00 -0400 |
---|---|---|
committer | Gordon Ross <gwr@nexenta.com> | 2016-10-13 17:18:25 -0400 |
commit | 5be4a8569b33229d1900ebf9cd167a028ef30a0c (patch) | |
tree | 303b881485158c6a0d8b094d2b822de2e0952b89 | |
parent | d3a7c6e6e21c5e5c3738a5275e607b9db4917ac3 (diff) | |
download | illumos-gfx-drm-5be4a8569b33229d1900ebf9cd167a028ef30a0c.tar.gz |
Fix sysheaders, mapfiles; rm quickbuild
-rwxr-xr-x | quickbuild | 214 | ||||
-rw-r--r-- | usr/src/Makefile | 13 | ||||
-rw-r--r-- | usr/src/uts/common/sys/Makefile | 37 | ||||
-rw-r--r-- | usr/src/uts/common/sys/foo.h | 15 |
4 files changed, 55 insertions, 224 deletions
diff --git a/quickbuild b/quickbuild deleted file mode 100755 index f957746..0000000 --- a/quickbuild +++ /dev/null @@ -1,214 +0,0 @@ -#!/bin/ksh -# -# This file and its contents are supplied under the terms of the -# Common Development and Distribution License ("CDDL"), version 1.0. -# You may only use this file in accordance with the terms of version -# 1.0 of the CDDL. -# -# A full copy of the text of the CDDL should have accompanied this -# source. A copy of the CDDL is also available via the Internet at -# http://www.illumos.org/license/CDDL. -# - -# -# Copyright 2014 Nexenta Systems, Inc. All rights reserved. -# - -# Use distributed make (dmake) by default. -make=${MAKE:-dmake} - -# Do this if you want to use dbx or gdb -# export SOURCEDEBUG=yes - -[ -n "$SRC" ] || { - echo "SRC not set. Run 'ws' or 'bldenv' first." - exit 1 -} - -cpu=`uname -p` -case $cpu in -i386) - x=intel - mdb_arch="ia32 amd64" - arch64=amd64 - ;; -sparc) - x=sparc - mdb_arch=v9 - arch64=sparcv9 - ;; -*) echo "Huh?" ; exit 1;; -esac - -################################################################ - -build_tools() { - test -f $SRC/tools/proto/root_i386-nd/opt/onbld/bin/genoffsets || - (cd $SRC/tools && $make install) - (cd $SRC/common/mapfiles/common; $make install) -} - -clobber_tools() { - (cd $SRC/tools && $make clobber) - (cd $SRC/common/mapfiles/common; $make clobber) -} - -################################################################ - -do_hdrs() { - -case $1 in -clean|clobber) - (cd $SRC/uts && $make -k clobber_h) - (cd $SRC/head && $make clobber) - ;; -install) - (cd $SRC && $make sgs) - ;; -*) - ;; -esac - -# Need some library headers too... -(cd $SRC/lib/libfoo && $make $targ) - -} - -################################################################ - -do_kern() { - case $1 in - lint) targ=modlintlib ;; - *) targ=$1 ;; - esac - ( unset SOURCEDEBUG ; - (cd $SRC/uts/$x/foo && $make $targ) - ) -} - -################################################################ - -do_libs() { - - (cd $SRC/lib && $make $1) - -} - -################################################################ - -do_cmds() { - - (cd $SRC/cmd && $make $1) - -} - -################################################################ - -do_mans() { - - (cd $SRC/man && $make $1) -} - - -################################################################ - -do_pkg() { - - (cd $SRC/pkg && $make $1) -} - - -################################################################ -# This builds $SRC/TAGS (and cscope.files) in a helpful order. - -do_tags() { - (cd $SRC ; - find uts/common/sys -name '*.[ch]' -print |sort - find lib/libfoo -name '*.[ch]' -print |sort - find cmd/foo -name '*.[ch]' -print |sort - ) > $SRC/cscope.files - - (cd $SRC ; - exctags -e -L - < cscope.files - cscope -b ) -} - -################################################################ -# This creates a tarfile one can use to update a test machine. - -do_tar() { - git_rev=`git rev-parse --short=8 HEAD` - files=" -kernel/drv/foo.conf -kernel/drv/$arch64/foo -kernel/drv/foo -usr/lib/libfoo.so.1 -usr/lib/libfoo.so -usr/bin/foo -" - - (cd $ROOT && tar cfj ../../on-skel-${git_rev}.tar.bz2 $files) -} - -################################################################ - -if [ "$1" = "" ]; then - set '?' # force usage -fi - -set -x - -for arg -do - case "$arg" in - install) - build_tools - set -e - do_hdrs $arg - do_kern $arg - do_libs $arg - do_cmds $arg - do_mans $arg - ;; - lint) - do_kern $arg - do_libs $arg - do_cmds $arg - ;; - check) - do_libs $arg - do_cmds $arg - do_mans $arg - do_pkg $arg - ;; - clean) - # intentionally skip: lib1, hdrs, tools - do_mans $arg - do_cmds $arg - do_libs $arg - do_kern $arg - ;; - clobber) - do_pkg $arg - do_mans $arg - do_cmds $arg - do_libs $arg - do_kern $arg - do_hdrs $arg - clobber_tools - ;; - pkg) - do_pkg install - ;; - tags) - do_tags - ;; - tar) - do_tar - ;; - *) - echo "Usage: $0 {install|lint|check|clean|clobber|pkg|tags|tar}"; - exit 1; - ;; - esac -done diff --git a/usr/src/Makefile b/usr/src/Makefile index 6825c3f..620ecc3 100644 --- a/usr/src/Makefile +++ b/usr/src/Makefile @@ -81,7 +81,7 @@ check := TARGET= check # cd pkg and do a 'make install' # -all: sgs .WAIT $(SUBDIRS) pkg +all: mapfiles sgs .WAIT $(SUBDIRS) pkg # # The _msg build is a two-step process. First, the _msg dependency @@ -102,7 +102,7 @@ install: install1 install2 _msg stage-licenses stage-licenses: install2 @cd pkg; pwd; $(MAKE) stage-licenses -install1: sgs +install1: mapfiles sgs install2: install1 $(SUBDIRS) @@ -111,12 +111,15 @@ _msg: _msgdirs rootdirs FRC cd $$m; pwd; $(MAKE) _msg; cd ..; \ done +mapfiles: bldtools + @cd common/mapfiles/common; pwd; $(MAKE) install + clean: $(SUBDIRS) head pkg clobber: $(SUBDIRS) head pkg clobber_local clobber_local: @cd tools; pwd; $(MAKE) clobber - @cd common/mapfiles; pwd; $(MAKE) clobber - @cd msg; pwd; $(MAKE) clobber + @cd common/mapfiles/common; pwd; $(MAKE) clobber +# @cd msg; pwd; $(MAKE) clobber # no closedbins here @@ -132,7 +135,7 @@ sgs: rootdirs .WAIT sysheaders userheaders .WAIT \ # Top-level setup target to setup the development environment that includes # headers, tools and generated mapfiles. # -setup: bldtools sgs +setup: bldtools sgs mapfiles bldtools: @cd tools; pwd; $(MAKE) install diff --git a/usr/src/uts/common/sys/Makefile b/usr/src/uts/common/sys/Makefile index 414e26e..40ba9fb 100644 --- a/usr/src/uts/common/sys/Makefile +++ b/usr/src/uts/common/sys/Makefile @@ -40,11 +40,38 @@ sparc_HDRS= # Generated headers GENHDRS= -CHKHDRS= +# Normal headers +CHKHDRS= \ + foo.h -HDRS= \ - $(GENHDRS) \ - $(CHKHDRS) +HDRS= $(GENHDRS) $(CHKHDRS) + +# from Makefile.syshdrs +ROOTDIR= $(ROOT)/usr/include/sys +sparc_ROOTDIRS= +i386_ROOTDIRS= +sparc_ROOTHDRS= +i386_ROOTHDRS= + +ROOTDIRS= \ + $(ROOTDIR) \ + $($(MACH)_ROOTDIRS) + +ROOTHDRS= \ + $($(MACH)_HDRS:%=$(ROOTDIR)/%) \ + $(HDRS:%=$(ROOTDIR)/%) + +$(ROOTDIR)/%: % + $(INS.file) + +$(ROOTDIRS): + $(INS.dir) + +#end Makefile.syshdrs + +CHECKHDRS= \ + $($(MACH)_HDRS:%.h=%.check) \ + $(CHKHDRS:%.h=%.check) all_h: $(GENHDRS) @@ -52,6 +79,7 @@ install_h: \ $(ROOTDIRS) \ .WAIT \ $(ROOTHDRS) \ + $($(MACH)_ROOTHDRS) clean: $(RM) $(GENHDRS) @@ -61,4 +89,3 @@ clobber: clean check: $(CHECKHDRS) FRC: - diff --git a/usr/src/uts/common/sys/foo.h b/usr/src/uts/common/sys/foo.h index c1db064..ddc515a 100644 --- a/usr/src/uts/common/sys/foo.h +++ b/usr/src/uts/common/sys/foo.h @@ -13,9 +13,24 @@ * Copyright 2014 Nexenta Systems, Inc. All rights reserved. */ +#ifndef _SYS_FOO_H +#define _SYS_FOO_H + +#include <sys/types.h> + +#ifdef __cplusplus +extern "C" { +#endif + #define FOO_IOC_GETCNT 1 typedef uint32_t foocnt_t; #ifndef _KERNEL extern int foo_getcnt(uint32_t *); #endif + +#ifdef __cplusplus +} +#endif + +#endif /* _SYS_FOO_H */ |