SCOUG-Programming Mailing List Archives
Return to [ 24 |
February |
2003 ]
Content Type: text/plain
> I just read Greg Smith's Open Source article on SCOUG.
>
> I don't understand how to organize the file tree. I'm familiar with the
> bin doc src subdirectories but I don't know if there's a specification
> on how the containing directory is to be placed.
>
> Suppose you have the source for five independent apps (AAA through
> EEE). What should the development tree look like (including the various
> utilities required for make/compile), and what should the user's
> execution tree look like (or are the development tree and the execution
> tree one-and-the-same)?
>
> - Peter
It depends very much on the application. HPCalc is simple enough
to stick everything in one directory. On many Unix systems you
will find the sources under the /usr/src directory. The code for
application A will be in /usr/src/app_A, applicaton B will be in
/usr/src/app_B, and so on. If you are developing new versions,
you will see /usr/src/app_A-4.1, /usr/src/app_A-4.2dev, etc. If
the application is complex, then the programmer will have additional
subdirectories.
If you look at the code organization for FreeBSD version 4.7 kernel
-rw-r--r-- 1 root wheel 638 Jul 10 2000 Makefile
drwxr-xr-x 12 root wheel 512 Dec 25 10:02 alpha
drwxr-xr-x 9 root wheel 512 Dec 25 10:02 boot
drwxr-xr-x 3 root wheel 512 Dec 25 10:02 cam
drwxr-xr-x 2 root wheel 512 Dec 25 10:02 coda
drwxr-xr-x 3 root wheel 512 Dec 25 10:02 compat
drwxr-xr-x 2 root wheel 512 Dec 25 10:02 compile
drwxr-xr-x 2 root wheel 512 Dec 25 10:02 conf
drwxr-xr-x 4 root wheel 512 Dec 25 10:02 contrib
drwxr-xr-x 8 root wheel 512 Dec 25 10:02 crypto
drwxr-xr-x 2 root wheel 1024 Dec 25 10:02 ddb
drwxr-xr-x 90 root wheel 1536 Dec 25 10:02 dev
drwxr-xr-x 4 root wheel 512 Dec 25 10:02 fs
drwxr-xr-x 5 root wheel 512 Dec 25 10:02 gnu
drwxr-xr-x 11 root wheel 512 Dec 25 10:02 i386
drwxr-xr-x 9 root wheel 512 Dec 25 10:02 i4b
drwxr-xr-x 3 root wheel 512 Dec 25 10:02 isa
drwxr-xr-x 3 root wheel 512 Dec 25 10:02 isofs
drwxr-xr-x 2 root wheel 3072 Dec 25 10:02 kern
drwxr-xr-x 3 root wheel 1024 Dec 25 10:02 libkern
drwxr-xr-x 12 root wheel 512 Dec 25 10:02 miscfs
drwxr-xr-x 135 root wheel 2048 Dec 25 10:02 modules
drwxr-xr-x 2 root wheel 512 Dec 25 10:02 msdosfs
drwxr-xr-x 2 root wheel 2048 Dec 25 10:02 net
drwxr-xr-x 2 root wheel 512 Dec 25 10:02 netatalk
drwxr-xr-x 6 root wheel 1024 Dec 25 10:02 netatm
drwxr-xr-x 2 root wheel 1536 Dec 25 10:02 netgraph
drwxr-xr-x 2 root wheel 1536 Dec 25 10:02 netinet
drwxr-xr-x 2 root wheel 1536 Dec 25 10:02 netinet6
drwxr-xr-x 2 root wheel 512 Dec 25 10:02 netipx
drwxr-xr-x 2 root wheel 512 Dec 25 10:02 netkey
drwxr-xr-x 2 root wheel 512 Dec 25 10:02 netnatm
drwxr-xr-x 2 root wheel 512 Dec 25 10:02 netncp
drwxr-xr-x 2 root wheel 512 Dec 25 10:02 netns
drwxr-xr-x 2 root wheel 512 Dec 25 10:02 netsmb
drwxr-xr-x 2 root wheel 1024 Dec 25 10:02 nfs
drwxr-xr-x 2 root wheel 512 Dec 25 10:02 ntfs
drwxr-xr-x 2 root wheel 512 Dec 25 10:02 nwfs
drwxr-xr-x 7 root wheel 512 Dec 25 10:02 pc98
drwxr-xr-x 2 root wheel 512 Dec 25 10:02 pccard
drwxr-xr-x 2 root wheel 1536 Dec 25 10:02 pci
drwxr-xr-x 2 root wheel 512 Dec 25 10:02 posix4
drwxr-xr-x 2 root wheel 1536 Dec 25 10:02 svr4
drwxr-xr-x 2 root wheel 3072 Dec 25 10:02 sys
drwxr-xr-x 5 root wheel 512 Dec 25 10:02 ufs
drwxr-xr-x 2 root wheel 1024 Dec 25 10:02 vm
Where alpha contains machine specific code for the DEC alpha
processor, boot contains code for the bootstrap loader, i386
contains machine specific code for Intel processors, etc.
Each subdirectory may have additional subdirectroies as needed.
The first few directories are organized as shown below:
sys/
sys/alpha
sys/alpha/alpha
sys/alpha/conf
sys/alpha/include
sys/alpha/include/pc
sys/alpha/isa
sys/alpha/linux
sys/alpha/mcbus
sys/alpha/osf1
sys/alpha/pci
sys/alpha/tc
sys/alpha/tlsb
sys/boot
sys/boot/alpha
sys/boot/alpha/boot1
sys/boot/alpha/cdboot
sys/boot/alpha/common
sys/boot/alpha/libalpha
sys/boot/alpha/loader
sys/boot/alpha/netboot
sys/boot/arc
sys/boot/arc/include
sys/boot/arc/lib
sys/boot/arc/lib/arch
sys/boot/arc/lib/arch/alpha
sys/boot/arc/loader
sys/boot/common
sys/boot/ficl
sys/boot/ficl/alpha
sys/boot/ficl/i386
sys/boot/ficl/softwords
sys/boot/forth
sys/boot/i386
sys/boot/i386/boot0
sys/boot/i386/boot2
sys/boot/i386/btx
sys/boot/i386/btx/btx
sys/boot/i386/btx/btxldr
sys/boot/i386/btx/lib
sys/boot/i386/cdboot
sys/boot/i386/kgzldr
sys/boot/i386/libi386
sys/boot/i386/loader
sys/boot/i386/mbr
sys/boot/i386/pxeldr
sys/boot/pc98
sys/boot/pc98/boot0
sys/boot/pc98/boot0.5
sys/boot/pc98/boot2
sys/boot/pc98/btx
sys/boot/pc98/btx/btx
sys/boot/pc98/btx/btxldr
sys/boot/pc98/btx/lib
sys/boot/pc98/kgzldr
sys/boot/pc98/libpc98
sys/boot/pc98/loader
sys/cam
sys/cam/scsi
sys/coda
sys/compat
sys/compat/linux
Each directory has a Makefile so that the make process can
recursively traverse through through the tree during the build.
To start the build, edit your configuration file MYKERNEL
in the /usr/src/sys/i386/conf directory, then give the
following commands:
# cd /sur/src/sys/i386/conf
# /usr/sbin/config MYKERNEL
# cd /usr/src/sys/compile/MYKERNEL
# make depend
# make
# make install
The config program (line 2) generates a complete makefile
in the directory /usr/src/sys/compile/MYKERNEL. The
"make depend" command recurses through the directory
tree resolving dependencies by updating the dynamicly
generated files. The "make" command does the compile
and linking. Finally, the "make install" command copies
the binaries to their proper place in the system and
tweaks any system configuration files that need updating.
--
Gregory W. Smith (WD9GAY) gsmith@well.com
=====================================================
To unsubscribe from this list, send an email message
to "steward@scoug.com". In the body of the message,
put the command "unsubscribe scoug-programming".
For problems, contact the list owner at
"rollin@scoug.com".
=====================================================
Return to [ 24 |
February |
2003 ]
The Southern California OS/2 User Group
P.O. Box 26904
Santa Ana, CA 92799-6904, USA
Copyright 2001 the Southern California OS/2 User Group. ALL RIGHTS
RESERVED.
SCOUG, Warp Expo West, and Warpfest are trademarks of the Southern California OS/2 User Group.
OS/2, Workplace Shell, and IBM are registered trademarks of International
Business Machines Corporation.
All other trademarks remain the property of their respective owners.
|