SimpleBean   Makefile

reference: from 'Writing a SimpleBean', ' The Java Tutorial' , at the Sun site
Other examples can be located in the BDK1.1 distribution


Below are two makefiles (Unix and Windows) set up to create SimpleBean.

          # gnumake file

          CLASSFILES= SimpleBean.class

          JARFILE= SimpleBean.jar

          all: $(JARFILE)

          # Create a JAR file with a suitable manifest.
          $(JARFILE): $(CLASSFILES) $(DATAFILES)
                  echo "Name: SimpleBean.class" >> manifest.tmp
                  echo "Java-Bean: True" >> manifest.tmp
                  jar cfm $(JARFILE) manifest.tmp *.class
                  @/bin/rm manifest.tmp

          # Compile the sources
          %.class: %.java
                  export CLASSPATH; CLASSPATH=. ; \
                  javac $<

          # make clean
          clean:
                  /bin/rm -f *.class
                  /bin/rm -f $(JARFILE)



Here is the Windows nmake version:
 

          # nmake file
          CLASSFILES= simplebean.class

          JARFILE= simplebean.jar

          all: $(JARFILE)

          # Create a JAR file with a suitable manifest.

          $(JARFILE): $(CLASSFILES) $(DATAFILES)
                  jar cfm $(JARFILE) <<manifest.tmp *.class
          Name: SimpleBean.class
          Java-Bean: True
          <<

          .SUFFIXES: .java .class

          {sunw\demo\simple}.java{sunw\demo\simple}.class :
                  set CLASSPATH=.
                  javac $<

          clean:
                  -del sunw\demo\simple\*.class
                  -del $(JARFILE)

     You can use these makefiles as templates for creating your own Bean makefiles. The example Bean makefiles, in
     the beans/demo directory, also show you how to use makefiles to build and maintain your Beans.