📄 imake.rules
字号:
*/#ifndef BuildMakefileTarget#define BuildMakefileTarget(notused,imakeflags) @@\ImakeDependency(Makefile) @@\ @@\Makefile:: @@\ RMoveToBakFile(Makefile) @@\ $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR) imakeflags#endif /* BuildMakefileTarget *//* * MakefileTarget - generate rules to build a normal Makefile. */#ifndef MakefileTarget#define MakefileTarget() @@\BuildMakefileTarget(Imakefile,NullParameter)#endif /* MakefileTarget *//* * LibMkdir - helper for creating library object subdirectories */#ifndef LibMkdir#define LibMkdir(dir) DirFailPrefix@if [ -d dir ]; then exit 0; else set -x; mkdir dir; fi#endif#ifndef LibMkdirLinkSubdirs#define LibMkdirLinkSubdirs(dir) DirFailPrefix@if [ -d dir ]; then \ @@\ exit 0; \ @@\ else \ @@\ echo "mkdir dir"; mkdir dir; \ @@\ for i in $(SUBDIRS); do \ @@\ j=`echo "$$i" | sed -e 's;[^/]\{1,\};..;g'`; \ @@\ $(MKDIRHIER) "dir/`dirname $$i`"; \ @@\ echo $(LN) "$$j/$$i/dir" "dir/$$i"; \ @@\ $(LN) "$$j/$$i/dir" "dir/$$i"; \ @@\ done; \ @@\ fi#endif/* * LibCleanDir - helper for cleaning library object subdirectories */#ifndef LibCleanDir#define LibCleanDir(dir) -@if [ -d dir ]; then \ @@\ set -x; $(RM) -r dir; else exit 0; fi#endif/* * LintLibReferences - variables for lint libraries */#ifndef LintLibReferences#define LintLibReferences(varname,libname,libsource) @@\Concat(LINT,varname) = _UseCat($(LINTLIBDIR)/llib-l,libsource/llib-,libname.ln)#endif/* * UnsharedLibReferences - variables for unshared libraries */#ifndef UnsharedLibReferences#define UnsharedLibReferences(varname,libname,libsource) @@\ProjectUnsharedLibReferences(varname,libname,libsource,$(BUILDLIBDIR))#endif/* * ProjectUnsharedLibReferences - variables for unshared libraries */#ifndef ProjectUnsharedLibReferences#define ProjectUnsharedLibReferences(varname,libname,libsource,buildlibdir) @@\Concat3(DEP,varname,LIB) = _UseCat($(USRLIBDIR)/,buildlibdir/,LibraryTargetName(libname)) @@\Concat(varname,LIB) = LoaderLibPrefix Concat(-l,libname) @@\LintLibReferences(varname,libname,libsource)#endif/* * SharedLibDependencies - shared library dependencies */#ifndef SharedLibDependencies#define SharedLibDependencies(libname,libsource,revname) /**/#endif/* * SharedDSLibDependencies - shared library dependencies with data separation */#ifndef SharedDSLibDependencies#define SharedDSLibDependencies(libname,libsource,revname) /**/#endif/* * SharedLibReferences - variables for shared libraries */#ifndef SharedLibReferences#define SharedLibReferences(varname,libname,libsource,revname,rev) @@\revname = rev @@\Concat3(DEP,varname,LIB) = SharedLibDependencies(libname,libsource,revname) @@\Concat(varname,LIB) = LoaderLibPrefix Concat(-l,libname) @@\LintLibReferences(varname,libname,libsource)#endif/* * SharedDSLibReferences - variables for shared libraries with data separation */#ifndef SharedDSLibReferences#define SharedDSLibReferences(varname,libname,libsource,revname,rev) @@\revname = rev @@\Concat3(DEP,varname,LIB) = SharedDSLibDependencies(libname,libsource,revname) @@\Concat(varname,LIB) = LoaderLibPrefix Concat(-l,libname) @@\LintLibReferences(varname,libname,libsource)#endif/* * CPPOnlyCompile - run C compiler's preprocessor only */#ifndef CPPOnlyCompile#define CPPOnlyCompile(src,options) RemoveFile($@) @@\ ClearmakeOSName \ $(CC) -E $(CFLAGS) options src > $@#endif/* * ObjectCompile - compile fragment for a normal object file */#ifndef ObjectCompile#define ObjectCompile(options) RemoveFile($@) @@\ ClearmakeOSName \ $(CC) -c $(CFLAGS) options $*.c#endif#ifndef ObjectCplusplusCompile#define ObjectCplusplusCompile(options) RemoveFile($@) @@\ ClearmakeOSName \ $(CXX) -c $(CXXFLAGS) options $*.CCsuf#endif/* * NormalLibObjCompile - compile fragment for a normal library object file */#ifndef NormalLibObjCompile#define NormalLibObjCompile(options) ObjectCompile(options)#endif#ifndef NormalLibObjCplusplusCompile#define NormalLibObjCplusplusCompile(options) ObjectCplusplusCompile(options)#endif/* * NormalSharedLibObjCompile - compile fragment for shared objects */#ifndef NormalSharedLibObjCompile#define NormalSharedLibObjCompile(options) NormalLibObjCompile(options $(SHLIBDEF) $(SHAREDCODEDEF) $(PICFLAGS))#endif#ifndef NormalSharedLibObjCplusplusCompile#define NormalSharedLibObjCplusplusCompile(options) NormalLibObjCplusplusCompile(options $(SHLIBDEF) $(SHAREDCODEDEF) $(CXXPICFLAGS))#endif/* * LibObjCompile - compile fragment for unshared/profiled/debugged objects */#ifndef LibObjCompile#if HasGcc || HasGcc2#define LibObjCompile(dir,options) RemoveFiles($@ dir/$@) @@\ ClearmakeOSName \ $(CC) -c $(CCOPTIONS) $(ALLDEFINES) options $*.c -o dir/$@#else#define LibObjCompile(dir,options) RemoveFiles($@ dir/$@) @@\ ClearmakeOSName \ $(CC) -c $(CCOPTIONS) $(ALLDEFINES) options $*.c @@\ $(MV) $@ dir/$@#endif#endif#ifndef LibObjCplusplusCompile#if HasGcc || HasGcc2#define LibObjCplusplusCompile(dir,options) RemoveFiles($@ dir/$@) @@\ ClearmakeOSName \ $(CXX) -c $(CXXOPTIONS) $(CXXDEFINES) options $*.CCsuf -o dir/$@#else#define LibObjCplusplusCompile(dir,options) RemoveFiles($@ dir/$@) @@\ ClearmakeOSName \ $(CXX) -c $(CXXOPTIONS) $(CXXDEFINES) options $*.CCsuf @@\ $(MV) $@ dir/$@#endif#endif/* * DebuggedLibObjCompile - compile fragment for debugged objects */#ifndef DebuggedLibObjCompile#define DebuggedLibObjCompile(options) LibObjCompile(debugger,DebuggableCDebugFlags options)#endif#ifndef DebuggedLibObjCplusplusCompile#define DebuggedLibObjCplusplusCompile(options) LibObjCplusplusCompile(debugger,DebuggableCplusplusDebugFlags options)#endif/* * ProfiledLibObjCompile - compile fragment for profiled objects */#ifndef ProfiledLibObjCompile#define ProfiledLibObjCompile(options) LibObjCompile(profiled,ProfiledCDebugFlags options)#endif#ifndef ProfiledLibObjCplusplusCompile#define ProfiledLibObjCplusplusCompile(options) LibObjCplusplusCompile(profiled,ProfiledCplusplusDebugFlags options)#endif/* * UnsharedLibObjCompile - compile fragment for unshared objects */#ifndef UnsharedLibObjCompile#define UnsharedLibObjCompile(options) LibObjCompile(unshared,$(CDEBUGFLAGS) options)#endif#ifndef UnsharedLibObjCplusplusCompile#define UnsharedLibObjCplusplusCompile(options) LibObjCplusplusCompile(unshared,$(CXXDEBUGFLAGS) options)#endif/* * SharedLibObjCompile - compile fragment for shared objects */#ifndef SharedLibObjCompile#define SharedLibObjCompile(options) LibObjCompile(shared,options $(SHLIBDEF) $(SHAREDCODEDEF) $(PICFLAGS) $(CDEBUGFLAGS))#endif/* * NormalLibraryObjectRule - for simple libraries */#ifndef NormalLibraryObjectRule#define NormalLibraryObjectRule() @@\.c.Osuf: @@\ NormalLibObjCompile($(_NOOP_))#endif /* NormalLibraryObjectRule */#ifndef NormalCplusplusObjectRule#define NormalCplusplusObjectRule() @@\.CCsuf.Osuf: @@\ NormalLibObjCplusplusCompile($(_NOOP_))#endif#ifndef NormalFortranObjectRule#define NormalFortranObjectRule() @@\.f.Osuf: @@\ RemoveFile($@) @@\ ClearmakeOSName \ $(FC) -c $(FCFLAGS) $*.f#endif/* * SpecialObjectRule - generate rules to compile a file with special flags. */#ifndef SpecialObjectRule#define SpecialObjectRule(objs,depends,options) @@\objs: depends @@\ ObjectCompile(options)#endif /* SpecialObjectRule */#ifndef SpecialCplusplusObjectRule#define SpecialCplusplusObjectRule(baseobj,basedep,options) @@\baseobj.Osuf: basedep.CCsuf @@\ ObjectCplusplusCompile(options)#endif /* SpecialCplusplusObjectRule *//* * SpecialCObjectRule - generate rules to compile a C file with special flags. * also handles CodeCenter rules */#ifndef SpecialCObjectRule#define SpecialCObjectRule(basename,depends,options) @@\SpecialObjectRule(basename.Osuf,basename.c depends,options) @@\ @@\basename.i: basename.c depends @@\ CPPOnlyCompile(basename.c,options) @@\ @@\CenterLoadTarget(debug_src,basename.c,NullParameter,$(ALLDEFINES) options)#endif /* SpecialCObjectRule */#ifndef ObjectFromSpecialSource#define ObjectFromSpecialSource(dst,src,flags) @@\NoConfigRec(dst.c) @@\ @@\dst.c: src.c @@\ RemoveFile($@) @@\ $(LN) $? $@ @@\ @@\SpecialCObjectRule(dst,NullParameter,flags) @@\ @@\includes:: dst.c @@\ @@\depend:: dst.c @@\ @@\clean:: @@\ RemoveFile(dst.c)#endif /* ObjectFromSpecialSource */#ifndef LexFileExplicit#if HasClearmake /* provide a place to hang ClearmakeOSName */#define LexFileExplicit(file) @@\file.c: file.l @@\ ClearmakeOSName \ $(LEX) $(LFLAGS) file.l @@\ $(MV) lex.yy.c file.c#else#define LexFileExplicit(file) /* the default rule is fine */#endif#endif#ifndef LexFile#define LexFile(file) @@\LexFileExplicit(file) @@\ @@\depend:: file.c @@\ @@\clean:: @@\ RemoveFiles(lex.yy.c file.c)#endif /* LexFile */#ifndef YaccFile#if HasGnuMake#define YaccFile(file,flags) @@\depend:: file.c @@\ @@\file.h: file.c @@\ @@\file.c: file.y @@\ ClearmakeOSName \ $(YACC) flags file.y @@\ $(MV) y.tab.c file.c @@\ @if [ -f y.tab.h ]; then set -x; $(MV) y.tab.h file.h; \ @@\ else exit 0; fi @@\ @@\clean:: @@\ RemoveFiles(y.tab.c y.tab.h file.h file.c)#else#define YaccFile(file,flags) @@\depend:: file.c @@\ @@\file.h file.c: file.y @@\ ClearmakeOSName \ $(YACC) flags file.y @@\ $(MV) y.tab.c file.c @@\ @if [ -f y.tab.h ]; then set -x; $(MV) y.tab.h file.h; \ @@\ else exit 0; fi @@\ @@\clean:: @@\ RemoveFiles(y.tab.c y.tab.h file.h file.c)#endif#endif /* YaccFile */#ifndef YaccFileNoFlags#define YaccFileNoFlags(file) @@\depend:: file.c @@\ @@\file.c: file.y @@\ ClearmakeOSName \ $(YACC) file.y @@\ $(MV) y.tab.c file.c @@\ @@\clean:: @@\ RemoveFiles(y.tab.c file.c)#endif /* YaccFileNoFlags */#ifndef MakeLibrary#define MakeLibrary(libname,objlist) $(AR) libname objlist#endif#ifndef LinkBuildLibrary#ifdef UseInstalled#define LinkBuildLibrary(lib) $(_NULLCMD_)#else#define LinkBuildLibrary(lib) MakeDir($(BUILDLIBDIR)) @@\ RemoveFile($(BUILDLIBDIR)/lib) @@\ cd $(BUILDLIBDIR) && $(LN) $(BUILDLIBTOP)/$(CURRENT_DIR)/lib .#endif#endif /* LinkBuildLibrary */#ifndef _LinkBuildLibrary /* will get redefined elsewhere */#define _LinkBuildLibrary(lib) $(_NULLCMD_)#endif /* _LinkBuildLibrary *//* * NormalLibraryTarget - generate rules to create a library. */#ifndef NormalLibraryTarget#define NormalLibraryTarget(libname,objlist) @@\AllTarget(LibraryTargetName(libname)) @@\ @@\LibraryTargetName
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -