home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1994 June / NEBULA_SE.ISO / SourceCode / MiscKit / Makefile < prev    next >
Encoding:
Makefile  |  1994-03-29  |  8.9 KB  |  217 lines

  1. # Top-level MiscKit Makefile Version 1.2.2
  2. #
  3. # Originally By Mike Ferris as Part of MOKit
  4. # Modified by Don Yacktman for use by the MiscKit, by permission
  5. # Copyright (C) 1994, by Don Yacktman, all rights reserved.
  6.  
  7. # Warning:  do not use a tilde in ROOT:  it must be absolute!
  8. ROOT = 
  9. INSTALLROOT = $(ROOT)/LocalDeveloper
  10.  
  11. NAME = MiscKit
  12. AUDIOALERTS = YES # Anything but "YES" will shut them up.
  13.  
  14. # Put the architectures that you want on this line.  For the main library,
  15. # right now you will have to also modify the line in the Makefile (Source
  16. # directory) to get the library to have the same architectures.  Eventually
  17. # this flag will be used by that Makefile as well.
  18. ARCHITECTURES = m68k i386
  19.  
  20. DOC_INSTALL = $(INSTALLROOT)/Documentation/$(NAME)
  21. LIB_INSTALL = $(INSTALLROOT)/Libraries
  22. HEADER_INSTALL = $(INSTALLROOT)/Headers
  23. PALETTE_INSTALL = $(INSTALLROOT)/Palettes
  24. EXAMPLE_SRC_INSTALL = $(INSTALLROOT)/Examples/$(NAME)
  25. OLD_LIB_INSTALL = $(ROOT)/usr/local/lib
  26.  
  27. # These next six targets are all that should need to be modified in
  28. # order to add new MiscKit resources, as long as the resource has the
  29. # proper Misc* prefix naming convention and doesn't require links in
  30. # the Headers directory like the MiscFindPanel project does.
  31. BUNDLES = MiscFindPanel
  32. SUBLIBRARIES = MiscInspectorKit MiscSwapKit
  33. # Each of PALETTES_WITH_LIBS should only have a single .subproj!
  34. PALETTES_WITH_LIBS = MiscClockPalette MiscProgressPalette MiscDragViews \
  35.             MiscThreeStateButton MiscArrowButtonPalette MiscColorWells \
  36.             MiscValueFieldPalette MiscCircularSlider MiscLogSliderPalette
  37. PALETTES = $(PALETTES_WITH_LIBS) MiscCoolButtons MiscString
  38. # Examples that test the MiscKit but don't install to /LocalDeveloper/Examples
  39. TESTAPP_EXAMPLES = MiscLockFile MiscLogFile MiscPriorityQueue MiscString \
  40.             DragViewTest MiscStringRegex
  41. # Examples that test the MiscKit and do install to /LocalDeveloper/Examples
  42. EXAMPLEAPP_EXAMPLES = MiscStringService TreeView SearchBench TinyTerm \
  43.             receiptfilter MiscTree_Browser
  44. # Example stuff that installs to /LocalDeveloper/Examples but doesn't compile
  45. EXAMPLEOTHERS = Interfaces DocTemplates
  46.  
  47. # These are a special case and need to be dealt with in a special way in
  48. # the install target.  Look there and note how they are handled!
  49. LINKED_HEADERS = MiscSearchText.h MiscTBMK.h SearchableText.h regexpr.h
  50.  
  51. include Makefiles/MiscKit.version # grabs the version number
  52.  
  53. help:
  54.     @echo ""
  55.     @echo "************  Welcome to the MiscKit!  ************"
  56.     @echo ""
  57.     @echo "The following Makefile targets are available:"
  58.     @echo "    make install   -- build and install the MiscKit"
  59.     @echo "    make lib       -- build the MiscKit library"
  60.     @echo "    make bundles   -- build the MiscKit bundle projects"
  61.     @echo "    make palettes  -- build the MiscKit palette projects"
  62.     @echo "    make examples  -- build the MiscKit example epplications"
  63.     @echo "    make all       -- build all four of the above targets"
  64.     @echo "    make uninstall -- remove the MiscKit installation"
  65.     @echo "    make distclean -- clean the MiscKit to a pristine distribution"
  66.     @echo "    make help      -- print what you see right now"
  67.     @echo ""
  68.     @echo "Don't forget to read the README.rtf file to catch any last"
  69.     @echo "minute gotchas!  Before installing, you should check to see"
  70.     @echo "that you agree with the terms of the MiscKit license as it"
  71.     @echo "appears in License.rtf."
  72.     @echo ""
  73.     @echo "The MiscKit Version $(FULL_VERSION) (C) 1994 by Don Yacktman"
  74.     @echo ""
  75.     
  76. all: lib bundles examples palettes
  77.  
  78. lib:
  79.     @if test $(AUDIOALERTS) = YES; then sndplay Makefiles/MiscBuild.snd; fi
  80.     @echo "************ Library ************"
  81.     @(cd Source; make all "TARGET_ARCHS=$(ARCHITECTURES)"; )
  82.     @for i in $(SUBLIBRARIES) none ; do \
  83.         if [ $$i = none ] ; then continue; fi; \
  84.         echo "*** Making $$i sub-library" ; \
  85.         (cd Source/$$i; make all "TARGET_ARCHS=$(ARCHITECTURES)"; mv *.a ..) ; \
  86.     done ;
  87.  
  88. bundles:
  89.     @echo "************ Bundles ************"
  90.     @for i in $(BUNDLES) none ; do \
  91.         if [ $$i = none ] ; then continue; fi; \
  92.         echo "*** Making $$i class bundle" ; \
  93.         (cd Bundles/$$i; make "TARGET_ARCHS=$(ARCHITECTURES)"; ) ; \
  94.     done ;
  95.  
  96. examples: lib bundles
  97.     @echo "************ Examples ************"
  98.     @for i in $(TESTAPP_EXAMPLES) none ; do \
  99.         if [ $$i = none ] ; then continue; fi; \
  100.         echo "*** Making $$i test app" ; \
  101.         (cd Examples/$$i; make "TARGET_ARCHS=$(ARCHITECTURES)"; ) ; \
  102.     done ;
  103.     @for i in $(EXAMPLEAPP_EXAMPLES) none ; do \
  104.         if [ $$i = none ] ; then continue; fi; \
  105.         echo "*** Making $$i example app" ; \
  106.         (cd Examples/$$i; make "TARGET_ARCHS=$(ARCHITECTURES)"; ) ; \
  107.     done ;
  108.     
  109. palettes: bundles
  110.     @echo "************ Palettes ************"
  111.     @for i in $(PALETTES) none ; do \
  112.         if [ $$i = none ] ; then continue; fi; \
  113.         echo "*** Making $$i palette" ; \
  114.         (cd Palettes/$$i; make "TARGET_ARCHS=$(ARCHITECTURES)"; ) ; \
  115.     done ;
  116.  
  117. install: lib palettes
  118.     @echo "************ Installing MiscKit ************"
  119.     @echo "*** Installing libraries to $(LIB_INSTALL)"
  120.     mkdirs $(LIB_INSTALL) $(OLD_LIB_INSTALL)
  121.     (cd Source; tar -cf - lib*.a | (cd $(LIB_INSTALL); tar -xf - ;))
  122.     (cd $(OLD_LIB_INSTALL); rm -rf lib*misckit*.a ; \
  123.                 ln -s $(LIB_INSTALL)/libMiscKit.a libmisckit.a; \
  124.                 ln -s $(LIB_INSTALL)/libMiscKit_g.a libmisckit_g.a; \
  125.                 ln -s $(LIB_INSTALL)/libMiscKit.a libdaymisckit.a; \
  126.                 ln -s $(LIB_INSTALL)/libMiscKit_g.a libdaymisckit_g.a; )
  127.     for i in $(PALETTES_WITH_LIBS) none ; do \
  128.         if [ $$i = none ] ; then continue; fi; \
  129.         (cd Palettes/$$i; tar -cf - *.a | \
  130.                 (cd $(LIB_INSTALL); tar -xf - ;)) ; \
  131.     done ;
  132.     @echo "*** Installing headers to $(HEADER_INSTALL)"
  133.     mkdirs $(HEADER_INSTALL)
  134.     (cd Headers; tar -cf - * | (cd $(HEADER_INSTALL); tar -xf - ;))
  135.     for i in $(LINKED_HEADERS) none ; do \
  136.         if [ $$i = none ] ; then continue; fi; \
  137.         (rm -rf $(HEADER_INSTALL)/misckit/$$i ; ) \
  138.     done ;
  139.     for i in $(PALETTES_WITH_LIBS) none ; do \
  140.         if [ $$i = none ] ; then continue; fi; \
  141.          (cd Palettes/$$i/*.subproj; cp *.h $(HEADER_INSTALL)/misckit; ) \
  142.     done ;
  143. # Note that if you are handling linked headers, you'll need a special copy
  144. # here to copy the header to the destination header directory!  This is
  145. # NOT set up automatically above via the targets
  146.     (cd Projects/MiscFindPanel/SearchCategories; \
  147.                 tar -cf - *.h | (cd $(HEADER_INSTALL)/misckit; tar -xf - ;))
  148.     (cd Projects/MiscFindPanel/MiscFindPanel; \
  149.                 tar -cf - S*.h | (cd $(HEADER_INSTALL)/misckit; tar -xf - ;))
  150. # build the precomp header -- ***** need to use ARCHITECTURES here!
  151.     (cd $(HEADER_INSTALL)/misckit; cc -O -g -Wall -ObjC -precomp -arch i386\
  152.                 -arch m68k misckit.h -o misckit.p)
  153.     @echo "*** Installing documentation to $(DOC_INSTALL)"
  154.     rm -rf $(DOC_INSTALL)
  155.     mkdirs $(DOC_INSTALL)
  156.     (cd Documentation; tar -cf - * .??* | (cd $(DOC_INSTALL); tar -xf - ;))
  157.     @echo "*** Building index for documentation ***
  158.     ixbuild -cs $(DOC_INSTALL)
  159.     @echo "*** Installing palettes to $(PALETTE_INSTALL)"
  160.     mkdirs $(PALETTE_INSTALL)
  161. # this is inefficient speed-wise, but makes for smaller palettes than the
  162. # tar method because it strips them.  Installs only happen once, and the
  163. # saved space is significant, so we'll take the hit.
  164.     for i in $(PALETTES) none ; do \
  165.         if [ $$i = none ] ; then continue; fi; \
  166.          (cd Palettes/$$i; make install INSTALLDIR=$(PALETTE_INSTALL) \
  167.             "TARGET_ARCHS=$(ARCHITECTURES)"; ) \
  168.     done ;
  169.     @echo "*** Installing example source code to $(EXAMPLE_SRC_INSTALL)"
  170.     mkdirs $(EXAMPLE_SRC_INSTALL)
  171.     (cd Examples; tar -chf - $(EXAMPLEAPP_EXAMPLES) $(EXAMPLEOTHERS) .??* | \
  172.                 (cd $(EXAMPLE_SRC_INSTALL); tar -xf - ;))
  173. # SearchBench is a link, so we need to treat it special
  174. #    @rm $(EXAMPLE_SRC_INSTALL)/SearchBench
  175. #    @(cd Projects/MiscFindPanel; tar -chf - SearchBench | \
  176. #                (cd $(EXAMPLE_SRC_INSTALL); tar -xf - ;))
  177.     @if test $(AUDIOALERTS) = YES; then sndplay Makefiles/MiscFinish.snd; fi
  178.  
  179. uninstall:
  180.     @echo "************ Uninstalling MiscKit ************"
  181.     rm -rf $(LIB_INSTALL)/libMisc*.a $(OLD_LIB_INSTALL)/lib*misckit*.a \
  182.                 $(HEADER_INSTALL)/misckit \
  183.                 $(HEADER_INSTALL)/daymisckit \
  184.                 $(HEADER_INSTALL)/ExtendedApp.h \
  185.                 $(PALETTE_INSTALL)/Misc*.palette \
  186.                 $(DOC_INSTALL) $(EXAMPLE_SRC_INSTALL)
  187.     
  188. distclean:
  189.     @echo "************ Cleaning for distribution ************"
  190.     @(cd Source; make clean; )
  191.     @for i in $(SUBLIBRARIES) none ; do \
  192.         if [ $$i = none ] ; then continue; fi; \
  193.         (cd Source/$$i; make clean; ) \
  194.     done ;
  195.     @(cd Headers/misckit; rm -rf *.p; )
  196.     @for i in $(BUNDLES) none ; do \
  197.         if [ $$i = none ] ; then continue; fi; \
  198.         (cd Bundles/$$i; make clean; ) \
  199.     done ;
  200.     @for i in $(PALETTES) none ; do \
  201.         if [ $$i = none ] ; then continue; fi; \
  202.         (cd Palettes/$$i; make clean; ) \
  203.     done ;
  204.     @for i in $(TESTAPP_EXAMPLES) none ; do \
  205.         if [ $$i = none ] ; then continue; fi; \
  206.         (cd Examples/$$i; make clean; ) \
  207.     done ;
  208.     @for i in $(EXAMPLEAPP_EXAMPLES) none ; do \
  209.         if [ $$i = none ] ; then continue; fi; \
  210.         (cd Examples/$$i; make clean; ) \
  211.     done ;
  212. # get rid of those pesky .dir3_0.wmd files, but keep the top level one.
  213.     @cp .dir3_0.wmd .dir3_0.wmd~
  214.     find ./ -name .dir3_0.wmd -print | xargs rm -f
  215.     @cp .dir3_0.wmd~ .dir3_0.wmd
  216.     @rm .dir3_0.wmd~
  217.