📄 makefiles.4
字号:
.SH EXAMPLES.PPIf you want to set up a private copy of parts of a project,you should choose a directory inside your directory tree that will becomethe shadow projects source root directory.Then create symbolic links named .IR RULES " and " TEMPLATESto the real source root.If you don't want to modify the global include files,create a symbolic link to the.I includedirectory too, else copy the include directory and its content.copy the top level makefile, the .I Defaultsfile and the.I Targetdirs.archname file..PPFinally copy the desired sub tree together with allmakefiles and the .I Targetdirs.archname files that are located in the directories aboveyour part of the project that you want to have separately..SH FILES\&.\|.\|./RULES/*.br\&.\|.\|./DEFAULTS/*.br\&.\|.\|./TARGETS/*.br\&.\|.\|./TEMPLATES/*.SH "SEE ALSO".BR makerules (4),.BR make (1),.BR gmake (1),.BR smake (1)..PPIf you want to know, how to add new rules or how to add supportfor new operating systems or compilers look into .BR makerules (4)..SH DIAGNOSTICSDiagnostic messages depend on the make program.Have a look at the appropriate man page..SH NOTESThe scope of this manual is only the usage of .BR "leaf makefiles" .If you want to make changes to the .B make ruleshave a look at.BR makerules (4)..PP.I makefilescan be used with .IR "Sunpro make" ", " "Gnu make"and .IR smake .Although Gnu make runs on many platforms, it has no useful debugoutput..PPUse.IR "Sunpro make" " or " "smake"if you have problems with a makefile..IR "Sunpro make" " and " "smake" ,both have a \-D flag, that allows you to watch the makefilesafter the first expansion. Use this option, if you are in doubtif your makefile gets expanded the right way and if the rightrules are included.There is also a \-d option that gives debugging output while make is running. If you want more output, use \-dd, \-ddd and so on..PP.I Smakehas an option \-xM that shows you the include dependency formake rules..PP.ne 20The following is a list of all macros that are used in .IR makefiles .Do not use them unless their meaning has been explainedbefore..PP.BR \-O_ARCH ,.BR .OBJDIR ,.BR .SEARCHLIST ,.BR ALLTARGETS ,.BR AR ,.BR ARCH ,.BR ARCHDIR ,.BR ARCHDIRX ,.BR ARCH_DONE ,.BR ARFLAGS ,.BR AS ,.BR ASFLAGS ,.BR ASMFILES ,.BR ASOPTS ,.BR ASOPTX ,.BR CC ,.BR CCOM ,.BR CCOM_DEF ,.BR CFILES ,.BR CFLAGS ,.BR CHGRP ,.BR CHMOD ,.BR CHOWN ,.BR CLEAN_FILES ,.BR CLEAN_FILEX ,.BR CLOBBER_FILEX ,.BR COPTDYN ,.BR COPTGPROF ,.BR COPTOPT ,.BR COPTS ,.BR COPTX ,.BR CPP ,.BR CPPFLAGS ,.BR CPPOPTS ,.BR CPPOPTX ,.BR CTAGS ,.BR CURDIR ,.BR C_ARCH ,.BR DEFAULTSDIR ,.BR DEFAULTSROOT ,.BR DEFCCOM ,.BR DEFCCOM_DEF ,.BR DEFINCDIRS ,.BR DEFINCDIRS_DEF ,.BR DEFINSGRP ,.BR DEFINSMODE ,.BR DEFINSUSR ,.BR DEFUMASK ,.BR DEF_ROOT ,.BR DEP_DEP ,.BR DEP_FILE ,.BR DEP_SUFFIX ,.BR DIRNAME ,.BR DIRS ,.BR DYNLD ,.BR ETAGS ,.BR FLOAT_OPTIONS ,.BR HFILES ,.BR HOSTNAME ,.BR INCDIRS ,.BR INSDIR ,.BR INSGRP ,.BR INSGRP_DEF ,.BR INSMODE ,.BR INSMODE_DEF ,.BR INSTALL ,.BR INSUSR ,.BR INSUSR_DEF ,.BR INS_BASE ,.BR INS_KBASE ,.BR KARCH ,.BR KARCH_DEF ,.BR KDEFINES ,.BR K_ARCH ,.BR LD ,.BR LDCC ,.BR LDFLAGS ,.BR LDLIBS ,.BR LDOPTDYN ,.BR LDOPTS ,.BR LDOPTX ,.BR LDPATH ,.BR LIBS ,.BR LIBS_PATH ,.BR LIBX ,.BR LIB_KVM ,.BR LIB_MATH ,.BR LIB_PREFIX ,.BR LIB_SOCKET ,.BR LIB_SUFFIX ,.BR LN ,.BR LNDYNLIB ,.BR LOCALIZE ,.BR LORDER ,.BR MAKE ,.BR MK_FILES ,.BR MAKEPROG ,.BR MAKE_ARCH ,.BR MAKE_HOST ,.BR MAKE_MACH ,.BR MAKE_M_ARCH ,.BR MAKE_NAME ,.BR MAKE_OS ,.BR MAKE_OSDEFS ,.BR MAKE_OSREL ,.BR MANDIR ,.BR MANFILE ,.BR MANSECT ,.BR MANSECT_ADMIN ,.BR MANSECT_CMD ,.BR MANSECT_DEMOS ,.BR MANSECT_DEVICE ,.BR MANSECT_DRIVER ,.BR MANSECT_FILEFORM ,.BR MANSECT_GAMES ,.BR MANSECT_HDR ,.BR MANSECT_LIB ,.BR MANSECT_MACROS ,.BR MANSECT_NETWORK ,.BR MANSECT_SYSCALL ,.BR MANSECT_TABLES ,.BR MANSTYLE ,.BR MANSUFFIX ,.BR MANSUFF_ADMIN ,.BR MANSUFF_CMD ,.BR MANSUFF_DEMOS ,.BR MANSUFF_DEVICE ,.BR MANSUFF_DRIVER ,.BR MANSUFF_FILEFORM ,.BR MANSUFF_GAMES ,.BR MANSUFF_HDR ,.BR MANSUFF_LIB ,.BR MANSUFF_MACROS ,.BR MANSUFF_NETWORK ,.BR MANSUFF_SYSCALL ,.BR MANSUFF_TABLES ,.BR MARCH ,.BR MARCH_DEF ,.BR MKDEP ,.BR MKDEP_OUT ,.BR MKDIR ,.BR MV ,.BR M_ARCH ,.BR OARCH ,.BR OARCHDIR ,.BR OFILES ,.BR OINCSDIR ,.BR OLIBSDIR ,.BR OSDEFS ,.BR OSNAME ,.BR OSREL ,.BR O_ARCH ,.BR PALLDEP_FILE ,.BR PARCH ,.BR PARCH_DEF ,.BR PASMFILES ,.BR PDEP_FILE ,.BR PLOFILES ,.BR POFILES ,.BR PTARGET ,.BR PTARGET_BASE ,.BR PYOFILES ,.BR P_ARCH ,.BR RANLIB ,.BR RM ,.BR RMDEP ,.BR RMTARGET ,.BR RM_FORCE ,.BR RM_RECURS ,.BR RM_RF ,.BR RULESDIR ,.BR RUNPATH ,.BR SCRFILE ,.BR SHELL ,.BR SHL_SUFFIX ,.BR SRCFILE ,.BR SRCLIBS ,.BR SRCROOT ,.BR SUBARCH ,.BR SUBARCHDIR ,.BR SYMLINK ,.BR TAGS ,.BR TARGET ,.BR TARGETLIB ,.BR TARGETMAN ,.BR TARGET_BASE ,.BR TARGET_PATH ,.BR TSORT ,.BR UMASK ,.BR UMASK_DEF ,.BR UMASK_VAL ,.BR XARCH ,.BR XK_ARCH ,.BR XMK_FILE ,.BR XMAKEPROG ,.BR XM_ARCH ,.BR XP_ARCH ,.BR _CCOM ,.BR _DEFAULTSDIR ,.BR _DEFCCOM ,.BR _DEFINSGRP ,.BR _DEFINSMODE ,.BR _DEFINSUSR ,.BR _DEFUMASK ,.BR _DIRNAME ,.BR _INCDIRS ,.BR _MAKEPROG ,.BR _MARCH ,.BR _M_ARCH ,.BR _O_ARCH ,.BR _PARCH ,.BR _P_ARCH ,.BR _UNIQ ,.BR __CCOM ,.BR __DEFAULTSDIR ,.BR __DEFCCOM ,.BR __DEFINSGRP ,.BR __DEFINSMODE ,.BR __DEFINSUSR ,.BR __DEFUMASK ,.BR __DIRNAME ,.BR __INCDIRS ,.BR __MAKEPROG ,.BR __MARCH ,.BR __M_ARCH ,.BR __PARCH ,.BR __P_ARCH ,.SH BUGS.SH "Source Tree Hierarchy.LPThe following outline gives a quick tour through a typicalsource hierarchy:.LP.na.nh.PD 0.TP.B .../root directory of the source tree..RS.TP.B Makefilethe top Makefile.TP.B Targetdirsa file containing a list of directories that are neededfor that project.If the system needs different target lists dependingon the target system architecture , use target specific files in.B .../TARGETS/.TP\&.\|.\|..RE..TP.B .../RULES/the location of makefiles (included rules)..RS.TP.B rules.topthe mandatory include rules (needed to setup basic rules).TP.B rules.auxrules needed to install a non localized auxiliary file.TP.B rules.cmdrules needed to make an ordinary command (like /bin/sh).TP.B rules.drvrules needed to make a device driver.TP.B rules.librules needed to make a standard (nonshared) library.TP.B rules.locrules needed to install a localized auxiliary file.TP.B rules.manrules needed to install a localized manual page.TP.B rules.scrrules needed to install a localized shell script.TP.B rules.shlrules needed to make a shared library.TP.B rules.mksrules needed to make more than one target in a specific directory.TP.B rules.dirrules needed to make targets that are located in sub directoriesto the current directory.TP\&.\|.\|..RE..TP.B .../DEFAULTS/default definitions for various target architectures arelocated in this directory. Templates for some architectures canbe found in the.I .../TEMPLATES/directory..RS.TP.B Defaultsdefault definitions for that source tree. System dependentdefinitions are in .B .../DEFAULTS/Defaults.*.RE.TP.B .../TARGETS/target list definitions for various target architectures arelocated in this directory..TP.B .../TEMPLATES/templates that should be used inside the project(rename to Makefile, if it is the only makefile in that directory, rename to.I target.mk,if there is more than one target in that directory)..RS.TP.B DefaultsDefaults file for the source root directory.TP.B Defaults.linuxDefaults file for .IR linux .This should be installed in the .B .../DEFAULTS/directory..TP.B Makefile.rootMakefile for the source root directory.TP.B Makefile.auxMakefile for a non localized auxiliary file.TP.B Makefile.cmdMakefile for an ordinary command (like /bin/sh).TP.B Makefile.libMakefile for a standard (nonshared) library.TP.B Makefile.locMakefile for a localized auxiliary file.TP.B Makefile.manMakefile for a localized manual page.TP.B Makefile_de.manMakefile for a localized manual page in the german locale.TP.B Makefile.scrMakefile for a localized shell script.TP.B Makefile.shlMakefile for a shared library.TP.B Makefile.drvMakefile for a device driver.TP.B Makefile.mksMakefile for more than one target in a specific directory.TP.B Makefile.dirMakefile for targets that are located in sub directoriesto the current directory.TP\&.\|.\|..RE..TP.B .../cmd/source tree for normal commands..RS.TP.B Makefilethe makefile for the .I cmd sub directory.TP.B Targetdirs.sun4ma file containing a list of directories like .I myprog (see below) that are neededfor that specific architecture..TP.B myprog/directory where the sources for a specific command are located..RS.TPMakefilemakefile for.I myprog.TPMakefile.manmakefile for the manual page of.I myprog.TPmprog.csource for myprog.TPmprog.trtroff source for the manual page of myprog.TP.B OBJ/directory where system specific sub directories are located..RS.TP.B sparc\-sunos5\-cc/directory for binaries that belong to a specific system.TP\&.\|.\|..RE.TP\&.\|.\|..RE.br.TP\&.\|.\|..RE.br.ne 5.TP.B .../lib/directory where the sources for a libraries are located..RS.TP.B Makefilethe makefile for the .I lib sub directory.TP.B Targetdirs.sun4ma file containing a list of directories like .I libfoo(see below) that are neededfor that specific architecture..TP.B libfoo/directory where all source files for libfoo are located.TP\&.\|.\|..RE..TP.B .../kerneldirectory for kernel modules..RS.TP.B Makefilethe makefile for the .I kernelsub directory.TP.B Targetdirs.sun4ma file containing a list of directories like .I drv (see below) that are neededfor that specific architecture..TP.B drv/directory where drivers are located..RS.TP.B Makefilethe makefile for the .I drvsub directory.TP.B Targetdirs.sun4ma file containing a list of directories like .I mydrv(see below) that are neededfor that specific architecture..TP.B mydrv/source for a specific driver.TP\&.\|.\|..RE..TP\&.\|.\|..RE..TP.B .../includedirectory for global include files that are used in that project..TP.B .../binsdirectory for binary programs that are created/needed while compilingthe project.RS.TP.B sparc\-sunos5\-cc/directory for binaries that belong to a specific system.TP\&.\|.\|..RE..TP.B .../libsdirectory for libraries that are created/needed while compilingthe project.RS.TP.B sparc\-sunos5\-cc/directory for libraries that belong to a specific system.TP\&.\|.\|..RE..TP.B .../incsdirectory for include files that are created/needed while compilingthe project.RS.TP.B sparc\-sunos5\-cc/directory for include files that belong to a specific system.TP\&.\|.\|..RE.TP\&.\|.\|..RE..ad.PD.SH AUTHOR.nfJ\*org SchillingSeestr. 110D-13353 BerlinGermany.fi.PPMail bugs and suggestions to:.PP.Bjoerg@schily.isdn.cs.tu-berlin.deor.Bjs@cs.tu-berlin.deor.Bjes@fokus.gmd.de
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -