home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1995 November / PCWK1195.iso / inne / win95 / sieciowe / hotja32.lzh / hotjava / doc / native / makefile < prev    next >
Makefile  |  1995-05-19  |  2KB  |  83 lines

  1. #
  2. # @(#)Makefile 95/03/05 1.7
  3. #
  4. # Makefile for dynamically loaded native method example.
  5. #
  6. # NOTE: Change JAVAHOME to indicate the top level of your JAVA top
  7. #    level directory before building
  8. #
  9. # version     1.0, 01 Dec 1994
  10. # author    Eugene Kuerner
  11.  
  12. all        : library applet
  13.  
  14. JAVAC        = javac
  15. JAVAH        = javah
  16. #
  17. # Default JAVAHOME
  18. #
  19. DEFAULT_JAVAHOME=../..
  20. JAVAHOME=$(DEFAULT_JAVAHOME$(ALT_JAVAHOME))$(ALT_JAVAHOME)
  21. JAVASHAREINC    = $(JAVAHOME)/include
  22. JAVASOLARISINC    = $(JAVAHOME)/include/solaris
  23. JAVASOLARISBLD    = $(JAVAHOME)/include/CClassHeaders
  24. LIBRARY        = libfile
  25. CLASSSTUBDIR    = stubs
  26. CHEADERDIR    = CClassHeaders
  27. PACKAGEDIR    = demo
  28. STUBPREAMBLE    = $(JAVASHAREINC)/StubPreamble.h
  29.  
  30. CC        = cc
  31. LD        = /usr/ccs/bin/ld
  32. INCLUDES    = -I. -I$(CHEADERDIR) -I$(JAVASHAREINC) -I$(JAVASOLARISINC) \
  33.           -I$(JAVASOLARISBLD)
  34. CFLAGS        = $(INCLUDES) -c 
  35.  
  36. FILES.c        = libstubs.c        \
  37.           file.c
  38.  
  39. FILES.o        = libstubs.o        \
  40.           file.o
  41.  
  42. FILES.java    = File.java        \
  43.           InputFile.java        \
  44.           OutputFile.java
  45.  
  46. FILES.class    = File.class        \
  47.           InputFile.class    \
  48.           OutputFile.class
  49.  
  50. EXPORTEDCLASSES    = $(PACKAGEDIR).InputFile         \
  51.           $(PACKAGEDIR).OutputFile
  52.  
  53.  
  54. %.class        : $(PACKAGEDIR)/%.java
  55.           $(JAVAC) $<
  56.  
  57. %.o        : %.c
  58.           $(CC) $(CFLAGS) $<
  59.  
  60.  
  61. library        : classheaders $(FILES.o)
  62.           $(LD) -G -o $(LIBRARY).so $(FILES.o)
  63.  
  64. applet        : library Replace.java
  65.           $(JAVAC) Replace.java
  66.  
  67.  
  68. classheaders    : $(FILES.class)
  69.           for i in $(EXPORTEDCLASSES) ;                    \
  70.           do                            \
  71.               $(JAVAH) -classpath $(CLASSPATH) -d $(CHEADERDIR)/ $$i ;\
  72.           done
  73.  
  74. libstubs.c    : classheaders $(STUBPREAMBLE)
  75.           $(JAVAH) -classpath $(CLASSPATH) -d $(CLASSSTUBDIR)/    \
  76.               -stubs $(EXPORTEDCLASSES)
  77.           @ cat $(STUBPREAMBLE) $(CLASSSTUBDIR)/*.stubs > $@
  78.  
  79. clobber        : 
  80.           rm -rf $(CHEADERDIR) $(CLASSSTUBDIR) *.so *.class *.o \
  81.           $(PACKAGEDIR)/*.class libstubs.c
  82.