📄 imake.rules
字号:
install:: program.script @@\
MakeDir($(DESTDIR)dest) @@\
( set -x; $(INSTALL) -c $(INSTBINFLAGS) program.script $(DESTDIR)dest/program)
#endif /* InstallScript */
/*
* InstallNamedProg - install a program with renaming and no stripping.
*/
#ifndef InstallNamedProg
#define InstallNamedProg(srcname,dstname,dest) @@\
install:: srcname @@\
MakeDir($(DESTDIR)dest) @@\
( set -x; $(INSTALL) -c $(INSTBINFLAGS) srcname $(DESTDIR)dest/dstname)
#endif /* InstallNamedProg */
/*
* LinkFileList - link a list of list of files from one place to another
*/
#ifndef LinkFileList
#define LinkFileList(step,list,dir,sub) @@\
step:: list @@\
@case '${MFLAGS}' in *[i]*) set +e;; esac; \ @@\
echo " cd" dir; cd dir; \ @@\
for i in list; do (set -x; $(RM) $$i; $(LN) sub/$$i .); done
#endif
/*
* InstallMultipleDestFlags - generate rules to install multiple files at
* once during a particular step in the build using a specific set of install
* flags.
*/
#ifndef InstallMultipleDestFlags
#define InstallMultipleDestFlags(step,list,dest,flags) @@\
step:: list @@\
MakeDir($(DESTDIR)dest) @@\
@case '${MFLAGS}' in *[i]*) set +e;; esac; \ @@\
for i in list; do \ @@\
(set -x; $(INSTALL) -c flags $$i $(DESTDIR)dest); \ @@\
done
#endif /* InstallMultipleDestFlags */
/*
* InstallMultipleDest - generate rules to install multiple files at once
* during a particular step in the build using any install flags set in
* $(INSTALLFLAGS).
*/
#ifndef InstallMultipleDest
#define InstallMultipleDest(step,list,dest) @@\
InstallMultipleDestFlags(step,list,dest,$(INSTALLFLAGS))
#endif /* InstallMultipleDest */
/*
* InstallMultiple - generate rules to install multiple files at once
* during the install step of the build using any install flags set in
* $(INSTALLFLAGS).
*/
#ifndef InstallMultiple
#define InstallMultiple(list,dest) @@\
InstallMultipleDest(install,list,dest)
#endif /* InstallMultiple */
/*
* InstallMultipleFlags - generate rules to install multiple files at once
* during the install step of the build using the given install flags.
*/
#ifndef InstallMultipleFlags
#define InstallMultipleFlags(list,dest,flags) @@\
InstallMultipleDestFlags(install,list,dest,flags)
#endif /* InstallMultipleFlags */
/*
* InstallMultipleMan - generate rules to install a variety of manual pages
* during the install.man step of the build.
*/
#ifndef InstallMultipleMan
#define InstallMultipleMan(list,dest) @@\
InstallMultipleDestFlags(install.man,list,dest,$(INSTMANFLAGS))
#endif /* InstallMultipleMan */
/*
* InstallAppDefaults - generate rules to install appliation default files
* if the InstallAppDefFiles configuration parameter is set.
*/
#ifndef InstallAppDefaults
#if InstallAppDefFiles
#define InstallAppDefaults(class) @@\
install:: class.ad @@\
MakeDir($(DESTDIR)$(XAPPLOADDIR)) @@\
( set -x; $(INSTALL) -c $(INSTAPPFLAGS) class.ad $(DESTDIR)$(XAPPLOADDIR)/class)
#else
#define InstallAppDefaults(class)
#endif /* InstallAppDefFiles */
#endif /* InstallAppDefaults */
/*
* InstallAppDefaultsLong - generate rules to install appliation default files
* if the InstallAppDefFiles configuration parameter is set.
*/
#ifndef InstallAppDefaultsLong
#if InstallAppDefFiles
#define InstallAppDefaultsLong(file,class) @@\
install:: file.ad @@\
MakeDir($(DESTDIR)$(XAPPLOADDIR)) @@\
( set -x;$(INSTALL) -c $(INSTAPPFLAGS) file.ad $(DESTDIR)$(XAPPLOADDIR)/class)
#else
#define InstallAppDefaultsLong(file,class)
#endif /* InstallAppDefFiles */
#endif /* InstallAppDefaultsLong */
/*
* DependDependency - generate rules to build the makedepend program if
* this Imakefile is within the source tree.
*/
#ifndef DependDependency
#ifdef UseInstalled
#define DependDependency() /**/
#else
#define DependDependency() @@\
depend:: $(DEPEND) @@\
@@\
$(DEPEND): @@\
@echo "checking $@ over in $(DEPENDSRC) first..."; \ @@\
cd $(DEPENDSRC); $(MAKE); \ @@\
echo "okay, continuing in $(CURRENT_DIR)"
#endif /* UseInstalled */
#endif /* DependDependency */
/*
* DependTarget - generate rules to compute dependencies for all files listed
* in $(SRCS).
*/
#ifndef DependTarget
#define DependTarget() @@\
DependDependency() @@\
@@\
depend:: @@\
$(DEPEND) $(DEPENDFLAGS) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS)
#endif /* DependTarget */
/*
* DependTarget3 - generate rules to compute dependencies for all files given.
*/
#ifndef DependTarget3
#define DependTarget3(srcs1,srcs2,srcs3) @@\
DependDependency() @@\
@@\
depend:: @@\
$(DEPEND) $(DEPENDFLAGS) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- srcs1 @@\
$(DEPEND) -a $(DEPENDFLAGS) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- srcs2 @@\
$(DEPEND) -a $(DEPENDFLAGS) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- srcs3
#endif /* DependTarget3 */
/*
* CleanTarget - generate rules to remove any garbage files; the #* is here
* instead of in the definition of RM_CMD because System V will treat the
* pound sign in the RM_CMD variable as a comment.
*/
#ifndef CleanTarget
#define CleanTarget() @@\
clean:: @@\
$(RM_CMD) "#"*
#endif /* CleanTarget */
/*
* TagsTarget - generate rules to compute tags files for C source code.
*/
#ifndef TagsTarget
#define TagsTarget() @@\
tags:: @@\
$(TAGS) -w *.[ch] @@\
$(TAGS) -xw *.[ch] > TAGS
#endif /* TagsTarget */
/*
* ImakeDependency - generate rules to compile imake if this Imakefile is
* within the source tree.
*/
#ifndef ImakeDependency
#ifdef UseInstalled
#define ImakeDependency(target) /**/
#else
#define ImakeDependency(target) @@\
target:: $(IMAKE) @@\
@@\
$(IMAKE): @@\
@(cd $(IMAKESRC); if [ -f Makefile ]; then \ @@\
echo "checking $@ in $(IMAKESRC) first..."; $(MAKE) all; else \ @@\
echo "bootstrapping $@ from Makefile.ini in $(IMAKESRC) first..."; \ @@\
$(MAKE) -f Makefile.ini BOOTSTRAPCFLAGS="$(BOOTSTRAPCFLAGS)"; fi; \ @@\
echo "okay, continuing in $(CURRENT_DIR)")
#endif /* UseInstalled */
#endif /* ImakeDependency */
/*
* 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) @@\
ImakeDependency(Makefile) @@\
@@\
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 NormalFortranObjectRule
#define NormalFortranObjectRule() @@\
.f.o: @@\
$(RM) $@ @@\
$(FC) -c $(FCFLAGS) $*.f
#endif
#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(libname.lib) @@\
@@\
libname.lib: 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(libname.lib) @@\
@@\
libname.lib: 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(libname.lib) @@\
@@\
libname.lib: 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(libname.lib) @@\
@@\
libname.lib: 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(alias.lib) @@\
@@\
alias.lib: libname.lib @@\
$(RM) $@ @@\
$(LN) libname.lib $@
#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.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -