home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 39 / IOPROG_39.ISO / SOFT / sdkjava40.exe / data1.cab / fg_Samples / Samples / COM / security_com / makefile < prev    next >
Encoding:
Makefile  |  2000-05-04  |  2.3 KB  |  112 lines

  1. # makefile
  2. #
  3. # Created 09/08/97
  4. #
  5. # (C) Copyright 1995 - 1999 Microsoft Corporation.  All rights reserved.
  6. #
  7.  
  8.  
  9. !ifndef BUILD
  10. BUILD = debug
  11. !endif
  12.  
  13. JAVA_SDK_ROOT = ..\..\..
  14. JAVA_SDK_BIN = $(JAVA_SDK_ROOT)\Bin
  15.  
  16.  
  17. JAVASRC = \
  18.     CMyCOMObject.java \
  19.     Main.java
  20.  
  21. CLASSES = \
  22.     $(BUILD)\comsamp\CMyCOMObject.class \
  23.     $(BUILD)\demo\Main.class
  24.  
  25. COM_CLASSES = \
  26.     $(BUILD)\comsamp\IMyInterface.class \
  27.     $(BUILD)\comsamp\IMyCOMObjectSecurity.class
  28.  
  29. OBJ = \
  30.     $(BUILD)\comsamp.obj \
  31.     $(BUILD)\comsamp_i.obj
  32.  
  33. LIBS = advapi32.lib uuid.lib ole32.lib
  34.  
  35. BASE_NAME = comsamp
  36.  
  37. PDB = $(BUILD)\$(BASE_NAME).pdb
  38.  
  39. CL_SWITCHES = $(CL_SWITCHES) -I$(JAVA_SDK_ROOT)\Include -I$(BUILD)
  40. !if "$(BUILD)" == "debug"
  41. CL_SWITCHES = $(CL_SWITCHES) -Zi -Fd$(PDB)
  42. !else
  43. CL_SWITCHES = $(CL_SWITCHES) -Ox
  44. !endif
  45.  
  46. JVC = $(JAVA_SDK_BIN)\jvc
  47. JVC_SWITCHES = $(JVC_SWITCHES) -cp:p $(BUILD) -x- -nomessage -nologo
  48.  
  49. JAVATLB = $(JAVA_SDK_BIN)\jactivex /javatlb
  50.  
  51.  
  52. all: dirchk $(BUILD)\$(BASE_NAME).dll $(COM_CLASSES) $(CLASSES) sample
  53.  
  54. clean:
  55.     @if exist $(BUILD)\nul deltree /y $(BUILD)
  56.  
  57. sample: 
  58.     @if not exist sample mkdir sample
  59.     copy $(BUILD)\$(BASE_NAME).dll sample
  60.     @if not exist sample\comsamp mkdir sample\comsamp
  61.     xcopy /s $(BUILD)\comsamp sample\comsamp
  62.     @if not exist sample\demo mkdir sample\demo
  63.     xcopy /s $(BUILD)\demo sample\demo
  64.  
  65.  
  66. dirchk:
  67.     @if not exist $(BUILD)\nul mkdir $(BUILD)
  68.  
  69.  
  70. # build rules
  71.  
  72. $(BUILD)\$(BASE_NAME).dll: $(OBJ)
  73.     link -def:$(BASE_NAME).def -pdb:$(PDB) -out:$@ -dll $(OBJ) $(LIBS)
  74.  
  75. $(BUILD)\comsamp_i.c $(BUILD)\comsamp.h $(BUILD)\comsamp.tlb: comsamp.idl
  76.     midl /out $(BUILD) /h comsamp.h comsamp.idl
  77.  
  78. COM_JAVASRC = $(COM_CLASSES:.class=.java)
  79.  
  80. $(COM_JAVASRC): $(BUILD)\comsamp.tlb
  81.     $(JAVATLB) /xc /d $(BUILD) $(BUILD)\comsamp.tlb
  82.  
  83.  
  84. # Dependencies
  85.  
  86. comsamp.cpp: $(BUILD)\comsamp.h
  87. Main.java: CMyCOMObject.java
  88.  
  89.  
  90. # Inference rules
  91.  
  92. .SUFFIXES: .class .java
  93.  
  94. .cpp{$(BUILD)}.obj:
  95.     cl -c $(CL_SWITCHES) -Fo$@ $<
  96.  
  97. {$(BUILD)}.c{$(BUILD)}.obj:
  98.     cl -c $(CL_SWITCHES) -Fo$@ $<
  99.  
  100. .java.class:
  101.     $(JVC) $(JVC_SWITCHES) -d $(BUILD) $<
  102.  
  103. .java{$(BUILD)\comsamp}.class:
  104.     $(JVC) $(JVC_SWITCHES) -d $(BUILD) $<
  105.  
  106. .java{$(BUILD)\demo}.class:
  107.     $(JVC) $(JVC_SWITCHES) -d $(BUILD) $<
  108.  
  109. .java{$(BUILD)}.class:
  110.     $(JVC) $(JVC_SWITCHES) -d $(BUILD) $<
  111.  
  112.