⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 makefiles.4

📁 创建一个符合iso-9660标准的iso文件系统
💻 4
📖 第 1 页 / 共 3 页
字号:
. \" %Z%%M%	%I% %E% Copyr 1996 J. Schilling. \" User Manual page for makefile system. \".if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U.if t .ds s \(*b.if t .ds S SS.if n .ds a ae.if n .ds o oe.if n .ds u ue.if n .ds s sz.TH makefiles 4L "14. February 1997" "J\*org Schilling" "Schily\'s FILE FORMATS".\".TH makefiles 4L "14. February 1997" "J\*org Schilling" "GMD FOKUS FILE FORMATS".SH NAMEmakefiles \- users guide for compiling projects on different platforms.SH SYNOPSIS.B "make [target].br.B "gmake [target].br.B "smake [target].br.PPTarget may be one of:.TP 10\&.helpto get a list of possible targets and a short description..TPallto make the default targets.TPinstallto make and install the default targets(see .IR INS_BASE " and " INS_KBASEto learn how to modify the installation path)..TPibinsto make and install a target in .I SRCROOT/bins.TPdependto re-make dependency rules for all default targets.Note: All dependency files will automatically remade on the next run of make before they are included..TPcleanto remove .I core files and all intermediate object files..TPclobberto remove the targets from.IR clean ,all dependency files and all final targets.TPdistcleanto remove the targets from.IR clean " and " clobber and all made files for all architectures..TPtagsto make .IR vi (1)compatible tags.TPTAGSto make .IR emacs (1)compatible tags.TPconfigreserved for future use..TPrmtargetto remove the default target.TPrelinkto remove the default target and remake it immediately. This can beused to change .e.g LD_RUN_PATH in the executable..SH DESCRIPTIONMakefiles is a set of rules that allows compiling of structuredprojects with small and uniformly structured makefiles.All rules are located in a central directory.Compiling the projects on different platforms can be done withoutthe need to modify any of the makefiles that are locatedin the projects directories..PPThree make programs are supported:.IR "Sunpro make" , .I "GNU make"and.IR smake ..PP.I BSDmakecould be supported if it supports pattern matching rules correctly..PPThe main design goal was to have a set of small and easy to readmakefiles, each located in the project's leaf directory and therefore called.IR leaf -makefile..PPEach of these .IR leaf -makefiles,in fact contains no rule at all. It simply defines some macrosfor the .IR make -programand includes two files from a central make rule depository.The included files and the files that are recursively included define the rules that are needed to compile the project..PPEach .IR leaf -makefileis formed in a really simple way:.TP\(buIt first defines two macros that define the relative locationof the project's root directory and the name of the directorythat contains the complete set of of rules and then includesthe rule file .I rules.topfrom the directory that forms the central rule depository.You only have to edit the macro.I SRCROOTto reflect the relative location of the project's root directory..TP\(buThe next part of a .IR leaf -makefiledefines macros that describe the target and the source.You can only have one target per .IR leaf -makefile.Of course, there may be many source files, that are needed to createthat target.If you want to make more than one target in a specific directory,you have to put more than one makefile into that directory.This is the part of a makefile that describes a unique target.Edit this part to contain all source files, all local include filesand all non global compile time flags that are needed for your target.For a typical target this is as simple as filling in a form..TP\(buEach.IR leaf -makefilefinally includes a file from the rules directory that containsrules for the appropriate type of target that is to be madefrom this .IR leaf -makefile..PPThe makefile in each directory has to be called.IR Makefile .If you want to have more than one makefile in a specific directory,you have to choose different names for the other makefiles..PPThere are rules for the following type of targets:.TP 20commandsThe make rules for user level commands like.IR cat ", " ls etc. are located in the file .I rules.cmd.TPdriversThe make rules for device driversare located in the file .I rules.drv.TPlibrariesThe make rules for non shared librariesare located in the file .I rules.lib.TPshared librariesThe make rules for shared librariesare located in the file .I rules.shl.TPlocalized filesThe make rules for localized filesare located in the file .I rules.loc.TPnonlocalized filesThe make rules for non localized filesare located in the file .I rules.aux.TPshell scriptsThe make rules for shell scripts (a variant of localized files)are located in the file .I rules.scr.TPmanual pagesThe make rules for manual pages (a variant of localized files)are located in the file .I rules.man.TPdiverted makefilesThe make rules for projects that need to have more thanone makefile in a specific directoryare located in the file .I rules.mksIt contains a rule that diverts to the listed sub makefiles.Each sub makefile may be of any type..TPdirectoriesThe make rules for sub directoriesare located in the file .I rules.dir.SH "Macros/Variables Used In Rules.PPThe following is a description of the most important macrosused within the make rules..I NOTE: not all of them might be changed in a specific makefile.Carefully read the description and change only those macrosthat are intended to be used to change the behavior ofthe compilation..TP 13ARCHDIRcontains the location where object files and make targets will be placed.A typical name would be:.I "OBJ/sparc\-sunos5\-cc.brDo not change this macro...TPASFLAGSThe flags that are used with the assembler..brDo not change this macro...TPASMFILESa list of assembler source files, to be specified in aleaf makefile...TPASOPTSThe internal macro that contains the flags for the assembler.Change this macro if you want to change the behavior.Use: .B "ASOPTS= value"If you want to override the default value. If you want tooverride the default assembler flags from the command linecall:.B "make 'ASOPTS=value'"Use: .B "ASOPTS += value"If you want to add flags to the default value from within a makefile...TPASOPTXmay be used if you want to add flags to the assembler flags from thecommand line. Use:.B "make 'ASOPTX=value'..TPC_ARCHthis macro contains the c-compiler architecture name..brDo not change this macro...TPCCOMThis macro may be used from the command line to use a differentc-compiler than the default.Use:.B "make 'CCOM=gcc'to use .I gccfor the next run.Note: The value of .I CCOMmust not necessarily be identical to the real name of the c-compiler.It refers to a filename which contains the definition for thatc-compiler. This hint applies as well to all other macros that deal withthe name of the c-compiler.The only macro, that contains the real invocation name of the c-compiler,is .IR CC ..I CCis set inside the machine dependent configuration file in the centralrules depository and must not be changed elsewhere...TPCFILESa list of C source files, to be specified in aleaf makefile...TPCFLAGSThe flags that are used with the c-compiler.Do not use flags that belong to the c-preprocessor in the .IR COPTOPT ", " COPTS " and " COPTXmacros..brDo not change this macro...TPCLEAN_FILESA list of files ( besides the object files ) that will beremoved with.IR "make clean" ..brDo not change this macro...TPCLEAN_FILEXthis macro may be used to define additional files that shouldbe removed with.IR "make clean" ...TPCLOBBER_FILEXthis macro may be used to define additional files that shouldbe removed with.IR "make clobber" ...TPCOPTOPTThe c-compiler optimization flag. This flag is intended to be overridden either from a makefile or from command line...TPCOPTSThe internal macro that contains the flags for the c-compiler.Change this macro if you want to change the behavior.Use: .B "COPTS= value"If you want to override the default value. If you want tooverride the default c-compiler flags from the command linecall:.B "make 'COPTS=value'"Use: .B "COPTS += value"If you want to add flags to the default value from within a makefile...TPCOPTXmay be used if you want to add flags to the c-compiler flags from thecommand line. Use:.B "make 'COPTX=value'..TPCPPFLAGSThe flags that are used with the c-preprocessor.This macro as well as:.IR CPPOPTS " and " CPPOPTXare also used when compiling c-programs.They should contain only the following flags:.IR "\-Dname=value ", " \-Uname " , " .IR \-Idirectory " and " \-Ydirectory ..brDo not change this macro...TPCPPOPTSThe internal macro that contains the flags for the c-preprocessor.Change this macro if you want to change the behavior.Use: .B "CPPOPTS= value"If you want to override the default value. If you want tooverride the default c-preprocessor flags from the command linecall:.B "make 'CPPOPTS=value'"Use: .B "CPPOPTS += value"If you want to add flags to the default value from within a makefile...TPCPPOPTXmay be used if you want to add flags to the c-preprocessor flags from thecommand line. Use:.B "make 'CPPOPTX=value'..TPCURDIRThis macro contains the name of the sub directory that is currently processed..brDo not change this macro...TPDEFINSGRPthis macro may be set in the projects defaults file to set up thedefault group id for installation .TPDEFINSMODEthis macro may be set in the projects defaults file to set up thedefault file permission for installation .TPDEFINSUSRthis macro may be set in the projects defaults file to set up thedefault user id for installation .TPDEFUMASKthis macro may be set in the projects defaults file to set up thedefault .I umaskvalue for creating sub directories..TPDEFAULTSDIRthis macro may be set from command line or from the shell environmentif the user wants to use a different set of .I Defaultsfiles that is not located in the directory.B DEFAULTSin the source root directory.This may be used to hold two or more set of defaults that differ e.g. in theinstallation path or the C-compiler...TPDEFAULTSROOTthis macro may be set in a leaf makefile, if that makefile wants to usea .I Defaultsfile that is not located in .I $(DEFAULTSDIR)in the source root.This may be used, if a sub tree in a big project needs a different setup...TPDEFLTSDIRThis is an internally used macro that is set from .I $(DEFAULTSDIR) or from the internal defaults..brDo not change this macro...TPDEFLTSROOTThis is an internally used macro that is set from .I $(DEFAULTSROOT) or from the internal defaults..brDo not change this macro...TPDEFCCOMthe default name of the c-compiler. This is usually set in the file.I $(DEFLTSROOT)/$(DEFLTSDIR)/Defaultsor .IR $(DEFLTSROOT)/$(DEFLTSDIR)/Defaults.$(O_ARCH) ...TPDEFINCDIRSa list of directories that are searched by default in addition to the system include directories. If this macro is not set, .I $(SRCROOT)/includeis used...TPDIRNAMEthis macro needs to be set in the makefile that is located inthe .I "$(SRCROOT)directory.The value should be either set to the name of the directorywhere the makefile is located or to .BR SRCROOT .The value of this macro is updated automatically to follow the directory hierarchy.Do not change this macro in a make file other than the make filein the source root...TPDIRSthis macro needs to be set in a makefile that is located ina directory that contains diversion directories.It must contain a list of directory names where the diversionsgo to e.g..BR "DIRS= libfoo libbar libgarbage" ...TPHFILESfor normal operation, .I makefiles will automatically find which include files are neededfor compilation.However, if you want to create a tag file that includestags for definitions that occur within include files, you should set .I HFILESto be a list of include files containing such definitions...TPINCDIRSthis macro will normally be a copy from .IR DEFINCDIRS .You may however specify a different value in a leaf makefileor from command line. This will overwrite the defaults value...TPINS_BASEthis macro has to be specified in the file.I $(DEFLTSROOT)/$(DEFLTSDIR)/Defaultsor .IR $(DEFLTSROOT)/$(DEFLTSDIR)/Defaults.$(O_ARCH) .It must contain the path name of the root for installing general targets of the project.See.IR INSDIR . ..TPINS_KBASEthis macro has to be specified in the file.I $(DEFLTSROOT)/$(DEFLTSDIR)/Defaultsor .IR $(DEFLTSROOT)/$(DEFLTSDIR)/Defaults.$(O_ARCH) .It must contain the path name of the root for installing kernel modules from the project.See.IR INSDIR ...TPINSDIRthis macro has to be specified in the leaf makefile.It must contain the path name of a directory relative to.IR INS_BASE " or " INS_KBASE .The target will be installed into.I "$(INS_BASE)/$(INSDIR)" ...TPINSGRPthis macro may be set in a leaf makefile to set up thegroup id for installation .TPINSMODEthis macro may be set in a leaf makefile to set up thefile permission for installation .TPINSUSRthis macro may be set in a leaf makefile to set up theuser id for installation ..TPK_ARCHthis macro contains the kernel/machine architecture for thetarget machine (e.g..IR "sun3 sun4c sun4m sun4u 9000\-725 aviion" ).It is set to the output of.I "uname \-mconverted to lower case..brDo not change this macro...TPKARCHthis macro contains the kernel/machine architecture for thetarget machine (e.g..IR "sun3 sun4c sun4m sun4u 9000\-725 aviion" ).It is set to the output of.I "uname \-mconverted to lower case..brDo not change this macro unless you want to do a cross compilation...TPLDFLAGSThe flags that are used with the linker..brDo not change this macro...TPLDLIBSThe internal macro that holds the libraries that are used while linking the target..brDo not change this macro...TPLDOPTSThe internal macro that contains the flags for the linker.Change this macro if you want to change the behavior.Use: .B "LDOPTS= value"If you want to override the default value. If you want tooverride the default linker flags from the command linecall:.B "make 'LDOPTS=value'"Use: .B "LDOPTS += value"If you want to add flags to the default value from within a makefile...TPLDOPTXmay be used if you want to add flags to the linker flags from thecommand line. Use:.B "make 'LDOPTX=value'..TPLDPATHthe default library search path for the linker. This is usually set in the file.I $(DEFLTSROOT)/$(DEFLTSDIR)/Defaultsor .IR $(DEFLTSROOT)/$(DEFLTSDIR)/Defaults.$(O_ARCH) ...TPLIB_KVMa predefined macro that contains the operating system dependentname of a librarythat is needed by programs that read/write kernel virtual memory.Add .I "$(LIB_KVM)to your list of libraries (e.g..BR "LIBS= \-lintl $(LIB_KVM)" ),if your target uses kvm...TPLIB_MATHa predefined macro that contains the operating system dependentname of a librarythat is needed by programs that use routines of the math library.Add .I "$(LIB_MATH)to your list of libraries (e.g..BR "LIBS= \-lintl $(LIB_MATH)" ),if your target uses math subroutines...TPLIB_SOCKETa predefined macro that contains the operating system dependentname of a librarythat is needed by programs that use socket calls.Add .I "$(LIB_SOCKET)to your list of libraries (e.g..BR "LIBS= \-lintl $(LIB_SOCKET)" ),if your target uses sockets. Note: this should (for portability reasons)even be done on systems that don't require a socket library because they have the socket interface inside libc...TPLIBS_PATHthis macro contains the path to a directory where thoselibraries are located, that have been build duringa make run inside the current project..brDo not change this macro...TPM_ARCHthis macro contains the machine architecture for the

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -