我修改后的makefile如下:
#########################################################################
# COPYRIGHT (c) 2003-2005 by Macrovision Corporation.
# This software has been provided pursuant to a License Agreement
# containing restrictions on its use. This software contains
# valuable trade secrets and proprietary information of
# Macrovision Corporation and is protected by law. It may
# not be copied or distributed in any form or medium, disclosed
# to third parties, reverse engineered or used in any manner not
# provided for in said License Agreement except with the prior
# written authorization from Macrovision Corporation.
##########################################################################
#
# FLEXLM makefile for PCs
# If you have a real kit, change VENDORNAME=demo below to your real
# vendor daemon name
# Use nmake DLL=1 for dll clients
# Use nmake MD=1 for dynamic runtime library: msvcrt.lib
#
clean:;
if exist lmnewgen.obj ren lmnewgen.obj lmnewgen.sav
if exist lmnewgen_md.obj ren lmnewgen_md.obj lmnewgen_md.sav
if exist asrgen.obj copy asrgen.obj asrgen_obj.bak
if exist *.obj del *.obj
if exist lmnewgen_md.sav ren lmnewgen_md.sav lmnewgen_md.obj
if exist lmnewgen.sav ren lmnewgen.sav lmnewgen.obj
if exist asrgen_obj.bak move asrgen_obj.bak asrgen.obj
if exist lmnewgen.exe del lmnewgen.exe
if exist lmcrypt.exe del lmcrypt.exe
if exist $(DAEMON) del $(DAEMON)
if exist lmcode.c del lmcode.c
if exist lmcode.obj del lmcode.obj
if exist lm_new.c del lm_new*.c
if exist lm_new.obj del lm_new*.obj
if exist lsrvend.c del lsrvend.c
if exist lmflex.exe del lmflex.exe
if exist *.ilk del *.ilk
if exist vc60.pdb rename vc60.pdb vc60.sav
if exist *.p* del *.p*
if exist vc60.sav rename vc60.sav vc60.pdb
if exist $(VENDORNAME)$(LMGRNAME).lib del $(VENDORNAME)$(LMGRNAME).lib
if exist $(VENDORNAME).dll del $(VENDORNAME).dll
if exist $(VENDORNAME).exp del $(VENDORNAME).exp
if exist lmgr11.dll del lmgr11.dll
if exist lmgr11.exp del lmgr11.exp
if exist lmgr11.lib del lmgr11.lib
if exist *.bin del *.bin
if exist $(EVENTLOGMESSAGEFILE).h del $(EVENTLOGMESSAGEFILE).h
if exist $(EVENTLOGMESSAGEFILE).res del $(EVENTLOGMESSAGEFILE).res
if exist $(EVENTLOGMESSAGEFILE).rc del $(EVENTLOGMESSAGEFILE).rc
if exist $(EVENTLOGMESSAGEFILE2).h del $(EVENTLOGMESSAGEFILE2).h
if exist $(EVENTLOGMESSAGEFILE2).res del $(EVENTLOGMESSAGEFILE2).res
if exist $(EVENTLOGMESSAGEFILE2).rc del $(EVENTLOGMESSAGEFILE2).rc
veryclean: clean
if exist lmhostid.exe del lmhostid.exe
if exist lmver.exe del lmver.exe
if exist lmcksum.exe del lmcksum.exe
if exist lmdown.exe del lmdown.exe
if exist lmremove.exe del lmremove.exe
if exist lmreread.exe del lmreread.exe
if exist lmswitchr.exe del lmswitchr.exe
if exist lmstat.exe del lmstat.exe
if exist lmborrow.exe del lmborrow.exe
if exist lmdiag.exe del lmdiag.exe
if exist lminstall.exe del lminstall.exe
kitclean:
if exist lmcode.c del lmcode.c
if exist lmcode.obj del lmcode.obj
if exist lmcrypt.obj del lmcrypt.obj
if exist lm_new.c del lm_new.c
if exist lm_new.obj del lm_new.obj
if exist lmnewgen.exe del lmnewgen.exe
if exist lsvendor.obj del lsvendor.obj
if exist lmhostid.exe del lmhostid.exe
if exist lmver.exe del lmver.exe
if exist lmcksum.exe del lmcksum.exe
if exist lmdown.exe del lmdown.exe
if exist lmhostid.exe del lmhostid.exe
if exist lminstall.exe del lminstall.exe
if exist lmremove.exe del lmremove.exe
if exist lmreread.exe del lmreread.exe
if exist lmswitchr.exe del lmswitchr.exe
if exist lmstat.exe del lmstat.exe
if exist lmdiag.exe del lmdiag.exe
if exist lmver.exe del lmver.exe
if exist lmflex.exe del lmflex.exe
if exist lmgr11.dll del lmgr11.dll
if exist lmgr11.exp del lmgr11.exp
if exist lmgr11.lib del lmgr11.lib
if exist *.bin del *.bin
if exist $(EVENTLOGMESSAGEFILE).h del $(EVENTLOGMESSAGEFILE).h
if exist $(EVENTLOGMESSAGEFILE).res del $(EVENTLOGMESSAGEFILE).res
if exist $(EVENTLOGMESSAGEFILE).rc del $(EVENTLOGMESSAGEFILE).rc
if exist $(EVENTLOGMESSAGEFILE2).h del $(EVENTLOGMESSAGEFILE2).h
if exist $(EVENTLOGMESSAGEFILE2).res del $(EVENTLOGMESSAGEFILE2).res
if exist $(EVENTLOGMESSAGEFILE2).rc del $(EVENTLOGMESSAGEFILE2).rc
lmcrypt.obj: $(SRCDIR)\lmcrypt.c $(SRCDIR)\lm_code.h $(SRCDIR)\lmclient.h
$(CC) $(CFLAGS) $(SRCDIR)\lmcrypt.c
if exist lmcrypt.exe del lmcrypt.exe
编译通过了,找不到vendor_hostid.obj的原因是因为在makefile中的EXECS行没有将vendor_hsotid.obj加上去,我起初看的是flexlm sdk(v9.2)的一份说明上进行修改makefile,上面就没有说要把vendor_hostid.obj添加到EXECS行上。后来参考了V10.8版本的文档,里面说明让把vendor_hostid.obj添加到EXECS行。
但编译后生成的lic文件不对,应用软件识别不出来。
pdf上有这么一段,不知道是这么理解的:
Additional Steps for Production Use of a Vendor-Defined Hostid Type
To implement a real vendor-defined hostid type, you must write a function that can find the hostid that you want to use, then use that function’s return value instead of the fixed value VENDEF_ID in strncpy() in vendor_hostid.c:
if (idtype == VENDEF_ID_TYPE)
{
h->type = VENDEF_ID_TYPE;
strncpy(h->id.vendor, VENDEF_ID, MAX_HOSTID_LEN);
h->id.vendor[MAX_HOSTID_LEN] = 0;
return(h);
}
这是什么意思啊?有知道的大侠指点一下,谢谢!