📄 imake.rules
字号:
$(TAGS) -w *.[ch] @@\ $(TAGS) -xw *.[ch] > TAGS#endif /* TagsTarget *//* * BuildMakefileTarget - generate rules to build a Makefile from an Imakefile * and any special imake flags. This is generally done automatically by the * template or by any special Imakefiles. The first argument exists just * because imakeflags is usually empty and some preprocessors will complain * if an empty argument is passed as the sole argument to a macro. */#ifndef BuildMakefileTarget#define BuildMakefileTarget(notused,imakeflags) @@\Makefile:: @@\ -@if [ -f Makefile ]; then set -x; \ @@\ $(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \ @@\ else exit 0; fi @@\ $(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/* * LibCleanDir - helper for cleaning library object subdirectories */#ifndef LibCleanDir#define LibCleanDir(dir) -@if [ -d dir ]; then \ @@\ (set -x; cd dir; $(RM) *.o); else exit 0; fi#endif/* * ObjectCompile - compile fragment for a normal object file */#ifndef ObjectCompile#define ObjectCompile(options) $(RM) $@ @@\ $(CC) -c $(CFLAGS) options $*.c#endif/* * NormalLibObjCompile - compile fragment for a normal library object file */#ifndef NormalLibObjCompile#define NormalLibObjCompile(options) ObjectCompile(options)#endif/* * NormalSharedLibObjCompile - compile fragment for shared object when * a normal library is not being built */#ifndef NormalSharedLibObjCompile#define NormalSharedLibObjCompile(options) NormalLibObjCompile(options $(SHLIBDEF) $(SHAREDCODEDEF) $(PICFLAGS))#endif/* * LibObjCompile - compile fragment for shared/profiled/debugged objects */#ifndef LibObjCompile#define LibObjCompile(dir,options) $(RM) $@ dir/$@ @@\ $(CC) -c $(CCOPTIONS) $(ALLDEFINES) options $*.c @@\ $(MV) $@ dir/$@#endif/* * DebuggedLibObjCompile - compile fragment for debugged objects */#ifndef DebuggedLibObjCompile#define DebuggedLibObjCompile(options) LibObjCompile(debugger,-g options)#endif/* * ProfiledLibObjCompile - compile fragment for profiled objects */#ifndef ProfiledLibObjCompile#define ProfiledLibObjCompile(options) LibObjCompile(profiled,-pg 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.o: @@\ ObjectCompile($(_NOOP_))#endif /* NormalLibraryObjectRule */#ifndef ObjectFromSpecialSource#define ObjectFromSpecialSource(dst,src,flags) @@\dst.c: src.c @@\ $(RM) $@ @@\ $(LN) $? $@ @@\ @@\dst.o: dst.c @@\ ObjectCompile(flags) @@\ @@\depend:: dst.c @@\ @@\clean:: @@\ $(RM) dst.c#endif /* ObjectFromSpecialSource *//* * SpecialObjectRule - generate rules to compile a file with special flags. */#ifndef SpecialObjectRule#define SpecialObjectRule(objs,depends,options) @@\objs: depends @@\ ObjectCompile(options)#endif /* SpecialObjectRule *//* * NormalLibraryTarget - generate rules to create a library. */#ifndef NormalLibraryTarget#define NormalLibraryTarget(libname,objlist) @@\AllTarget(Concat(lib,libname.a)) @@\ @@\Concat(lib,libname.a): objlist @@\ $(RM) $@ @@\ $(AR) $@ objlist @@\ RanLibrary($@)#endif /* NormalLibraryTarget *//* * NormalLibraryTarget2 - generate rules to create a library in two steps. * This is used to create libraries with large numbers of files. */#ifndef NormalLibraryTarget2#define NormalLibraryTarget2(libname,objlist1,objlist2) @@\AllTarget(Concat(lib,libname.a)) @@\ @@\Concat(lib,libname.a): objlist1 objlist2 @@\ $(RM) $@ @@\ $(AR) $@ objlist1 @@\ $(AR) $@ objlist2 @@\ RanLibrary($@)#endif /* NormalLibraryTarget2 *//* * NormalLibraryTarget3 - generate rules to create a library in three steps. * This is used to create libraries with very large numbers of files. */#ifndef NormalLibraryTarget3#define NormalLibraryTarget3(libname,objlist1,objlist2,objlist3) @@\AllTarget(Concat(lib,libname.a)) @@\ @@\Concat(lib,libname.a): objlist1 objlist2 objlist3 @@\ $(RM) $@ @@\ $(AR) $@ objlist1 @@\ $(AR) $@ objlist2 @@\ $(AR) $@ objlist3 @@\ RanLibrary($@)#endif /* NormalLibraryTarget3 *//* * NormalDepLibraryTarget - generate rules to create a library. */#ifndef NormalDepLibraryTarget#define NormalDepLibraryTarget(libname,deplist,objlist) @@\AllTarget(Concat(lib,libname.a)) @@\ @@\Concat(lib,libname.a): deplist @@\ $(RM) $@ @@\ $(AR) $@ objlist @@\ RanLibrary($@)#endif /* NormalDepLibraryTarget *//* * SubdirLibraryRule - */#ifndef SubdirLibraryRule#define SubdirLibraryRule(objlist) @@\all:: DONE @@\ @@\DONE: objlist @@\ touch $@ @@\ @@\clean:: @@\ $(RM) DONE#endif /* SubdirLibraryRule *//* * ProfiledLibraryTarget - generate rules to create a profiled library. */#ifndef ProfiledLibraryTarget#define ProfiledLibraryTarget(libname,objlist) @@\AllTarget(Concat3(lib,libname,_p.a)) @@\ @@\Concat3(lib,libname,_p.a): objlist @@\ $(RM) $@ @@\ cd profiled; $(AR) ../$@ objlist @@\ RanLibrary($@)#endif /* ProfiledLibraryTarget *//* * DebuggedLibraryTarget - generate rules to create a debuggable library. */#ifndef DebuggedLibraryTarget#define DebuggedLibraryTarget(libname,objlist) @@\AllTarget(Concat3(lib,libname,_d.a)) @@\ @@\Concat3(lib,libname,_d.a): objlist @@\ $(RM) $@ @@\ cd debugger; $(AR) ../$@ objlist @@\ RanLibrary($@)#endif /* DebuggedLibraryTarget *//* * AliasedLibraryTarget - generate rules to link one library to another. */#ifndef AliasedLibraryTarget#define AliasedLibraryTarget(libname,alias) @@\AllTarget(Concat(lib,alias.a)) @@\ @@\Concat(lib,alias.a): Concat(lib,libname.a) @@\ $(RM) $@ @@\ $(LN) Concat(lib,libname.a) $@#endif /* AliasedLibraryTarget *//* * NormalRelocatableTarget - generate rules to produce a relocatable object * file instead of a library. */#ifndef NormalRelocatableTarget#define NormalRelocatableTarget(objname,objlist) @@\AllTarget(objname.o) @@\ @@\objname.o: objlist @@\ $(RM) $@ @@\ $(LD) $(LDCOMBINEFLAGS) objlist -o $@#endif /* NormalRelocatableTarget *//* * ProfiledRelocatableTarget - generate rules to produce a profiled relocatable * object file instead of a library. */#ifndef ProfiledRelocatableTarget#define ProfiledRelocatableTarget(objname,objlist) @@\AllTarget(Concat(objname,_p.o)) @@\ @@\Concat(objname,_p.o): objlist @@\ $(RM) $@ @@\ $(LD) -X -r objlist -o $@#endif /* ProfiledRelocatableTarget *//* * DebuggedRelocatableTarget - generate rules to produce a debuggable * relocatable object file instead of a library. */#ifndef DebuggedRelocatableTarget#define DebuggedRelocatableTarget(objname,objlist) @@\AllTarget(Concat(objname,_d.o)) @@\ @@\Concat(objname,_d.o): objlist @@\ $(RM) $@ @@\ $(LD) -X -r objlist -o $@#endif /* DebuggedRelocatableTarget *//* * LintLibraryTarget - generate rules to create a lint library. Note that the * lint library is always forced to be newer than the library itself. */#ifndef LintLibraryTarget#define LintLibraryTarget(libname,srclist) @@\lintlib:: Concat(llib-l,libname.ln) @@\ @@\Concat(llib-l,libname.ln): srclist @@\ $(RM) $@ @@\ $(LINT) Concat($(LINTLIBFLAG),libname) $(LINTFLAGS) srclist#endif /* LintLibraryTarget *//* * NormalLintTarget - generate rules to lint a set of sources. */#ifndef NormalLintTarget#define NormalLintTarget(srclist) @@\lint: @@\ $(LINT) $(LINTFLAGS) srclist $(LINTLIBS) @@\lint1: @@\ $(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS)#endif /* NormalLintTarget *//* * LintTarget - generate rules to lint $(SRCS) */#ifndef LintTarget#define LintTarget() @@\NormalLintTarget($(SRCS))#endif/* * LinkSourceFile - snag source file from some other directory */#ifndef LinkSourceFile#define LinkSourceFile(src,dir) @@\src: dir/src @@\ $(RM) $@ @@\ $(LN) $? $@ @@\#endif/* * LinkFile - link a file */#ifndef LinkFile#define LinkFile(tofile,fromfile) @@\tofile:: fromfile @@\ $(RM) $@ @@\ $(LN) $? $@#endif#ifndef MakeSubincludesForBuild#define MakeSubincludesForBuild(step,dir,srclist) @@\step:: dir srclist @@\ @-(list=`echo srclist | sed -e 's/[^ ]*\///g'`; \ @@\ set -x; cd dir; $(RM) $$list) @@\ @for i in srclist; do \ @@\ (set -x; cd dir; $(LN) ../$$i .); \ @@\ done @@\ @@\dir:: @@\ $(MKDIRHIER) dir @@\ @@\clean:: @@\ @-(if [ -d dir ]; then \ @@\ list=`echo srclist | sed -e 's/[^ ]*\///g'`; \ @@\ set -x; cd dir; $(RM) $$list; else exit 0; fi)#endif/* * NamedTargetSubdirs - recursively make a series of steps */#ifndef NamedTargetSubdirs#define NamedTargetSubdirs(name,dirs,verb,flags,subname) @@\name:: @@\ @case '${MFLAGS}' in *[ik]*) set +e;; esac; \ @@\ for i in dirs ;\ @@\
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -