开发protoolkit应用程序时,makefiles的制作很关键,下面简单叙述下makefiles文件的编写方法:(已protoolkit的测试文件make_install作为模板)

1、从protoolkit的安装目录下的obj文件夹下找到make_install这个文件,将它拷贝到你的开发的程序的文件目录下,重命名它,并对其一下内容进行必要的修改:

• Change the macro MAKEFILENAME to refer to the makefile by its new name.(改写MAKEFILENAME新的应用程序名称)
• Change the macros EXE and EXE_DLL to define output file names more suitable for your own application.(改写EXE和EXE_DLL为新的生成文件的名称)
• Change the macro PROTOOL_SRC to refer to the loadpoint of Pro/TOOLKIT.(改写PROTOOL_SRC为本机的protoolkit的安装目录)
• Change the macro OBJS to refer to the object files that will result from compiling your Pro/TOOLKIT source files.(改写OBJS的名称)
• Add targets for those object files. These contain instructions for compiling your C source files. The form of these target definitions can be copied from the ones in the original makefile.(改写C程序的资源文件名)
They generally take the following form:
myfile.o: myfile.c
  $(CC) $(CFLAGS) myfile.c(myfile.o中的myfile即为上述中改写OBJS的名称的名称,myfile.c中的myfile改写成C程序的资源文件名)
Note: The second line must start with a tab character.(上面代码中的第二行必须以Tab开头)

 

此外,如果原来开发的protoolkit应用程序改版了,makefiles文件也需要重新编写来生成相应的exe文件或者dll文件,makefiles文件是用protoolkit进行Pro/E二次开发的关键,一定要仔细掌握其编写和改写方法。

 posted on 2010-03-16 20:33  Alex.Shi  阅读(665)  评论(0编辑  收藏  举报