home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1995 August / NEBULA.mdf / SourceCode / MiscKit1.2.6 / Makefile < prev    next >
Encoding:
Makefile  |  1994-06-18  |  9.9 KB  |  236 lines

  1. # Top-level MiscKit Makefile Version 1.2.6
  2. # Originally By Mike Ferris as Part of MOKit
  3. # Modified by Don Yacktman for use by the MiscKit, by permission
  4. # Copyright (C) 1994, by Don Yacktman, all rights reserved.
  5.  
  6. #########################################################################
  7. # Here are things that you can safely configure...                      #
  8. #  1.  Where the MiscKit is installed                                   #
  9. #  2.  Whether or not the audio alerts are played                       #
  10. #  3.  Whether or not the README is forced upon you                     #
  11. #  4.  Which target architectures which are compiled                    #
  12. #########################################################################
  13.  
  14. # Change root to somewhere in your account if you can't install to
  15. # /LocalDeveloper...  Warning:  do not use a ~ in ROOT; it must be absolute!
  16. ROOT = 
  17.  
  18. # Go ahead and change these to suit your taste--and patience.
  19. AUDIOALERTS = YES # Anything but "YES" will shut them up.
  20. SHOWREADME = YES # Anything but "YES" will supress automatic opening...
  21.  
  22. # Below, uncomment the architectures that you want.  Make sure your compiler
  23. # actually supports the selected architectures for it to work!
  24. # Comment out any that aren't useful to you or your compiler won't support.
  25. MOTOROLA_ARCH = m68k # Motorola (680x0) architecture
  26. INTEL_ARCH = i386 # Intel x86 architecture
  27. HP_ARCH = #hppa # PA-RISC architecture
  28. SPARC_ARCH = #sparc # SPARC architecture
  29. POWER_ARCH = #m98k # Power PC architecture.  Yeah, this is wishful thinking!
  30. OTHER_ARCH = # Add other architectures here.  Alpha?  We can hope...
  31.  
  32. #########################################################################
  33. # Don't mess with anything beyond this line or you might mess something #
  34. # up beyond all hope of the gods and man.  Unless, of course, you       #
  35. # actually do know what you're doing...which may be the case...         #
  36. #########################################################################
  37.  
  38. ARCHITECTURES = $(MOTOROLA_ARCH) $(INTEL_ARCH) $(HP_ARCH) \
  39.         $(SPARC_ARCH) $(POWER_ARCH) $(OTHER_ARCH)
  40. ARCHIFY = /usr/lib/arch_tool -archify_list
  41. ARCH_FLAGS = `$(ARCHIFY) $(ARCHITECTURES)`
  42.  
  43. NAME = MiscKit
  44. INSTALLROOT = $(ROOT)/LocalDeveloper
  45. DOC_INSTALL = $(INSTALLROOT)/Documentation/$(NAME)
  46. LIB_INSTALL = $(INSTALLROOT)/Libraries
  47. HEADER_INSTALL = $(INSTALLROOT)/Headers
  48. PALETTE_INSTALL = $(INSTALLROOT)/Palettes
  49. EXAMPLE_SRC_INSTALL = $(INSTALLROOT)/Examples/$(NAME)
  50. OLD_LIB_INSTALL = $(ROOT)/usr/local/lib
  51.  
  52. # These next six targets are all that should need to be modified in
  53. # order to add new MiscKit resources, as long as the resource has the
  54. # proper Misc* prefix naming convention.
  55. BUNDLES = MiscFindPanel
  56. SUBLIBRARIES = MiscInspectorKit MiscSwapKit
  57. # Each of PALETTES_WITH_LIBS should only have a single .subproj!
  58. PALETTES_WITH_LIBS = MiscClockPalette MiscProgressPalette MiscDragViews \
  59.             MiscThreeStateButton MiscArrowButtonPalette MiscColorWells \
  60.             MiscValueFieldPalette MiscCircularSlider MiscLogSliderPalette\
  61.             MiscCalendarPalette MiscSoundPalette MiscTeePalette
  62. PALETTES = $(PALETTES_WITH_LIBS) MiscCoolButtons MiscString
  63. # Examples that test the MiscKit but don't install to /LocalDeveloper/Examples
  64. TESTAPP_EXAMPLES = MiscLockFile MiscLogFile MiscPriorityQueue MiscString \
  65.             DragViewTest MiscStringRegex TestExplodingMenus
  66. # Examples that test the MiscKit and do install to /LocalDeveloper/Examples
  67. EXAMPLEAPP_EXAMPLES = MiscStringService TreeView SearchBench TinyTerm \
  68.             receiptfilter MiscTree_Browser
  69. # Example stuff that installs to /LocalDeveloper/Examples but doesn't compile
  70. EXAMPLEOTHERS = Interfaces DocTemplates
  71.  
  72. include Makefiles/$(NAME).version # grabs the version number
  73.  
  74. help:
  75.     @echo ""
  76.     @echo "************  Welcome to the $(NAME)!  ************"
  77.     @echo ""
  78.     @echo "The following Makefile targets are available:"
  79.     @echo "    make install   -- build and install the $(NAME)"
  80.     @echo "    make lib       -- build the $(NAME) library"
  81.     @echo "    make bundles   -- build the $(NAME) bundle projects"
  82.     @echo "    make palettes  -- build the $(NAME) palette projects"
  83.     @echo "    make examples  -- build the $(NAME) example applications"
  84.     @echo "    make debug     -- build the $(NAME) debugging libraries"
  85.     @echo "    make all       -- build all five of the above targets"
  86.     @echo "    make uninstall -- remove the $(NAME) installation"
  87.     @echo "    make distclean -- clean the $(NAME) to a pristine distribution"
  88.     @echo "    make help      -- print what you see right now"
  89.     @echo ""
  90.     @echo "Don't forget to read the README.rtf file to catch any last"
  91.     @echo "minute gotchas!  Before installing, you should check to see"
  92.     @echo "that you agree with the terms of the $(NAME) license as it"
  93.     @echo "appears in License.rtf."
  94.     @echo ""
  95.     @echo "The $(NAME) Version $(FULL_VERSION) (C) 1994 by Don Yacktman"
  96.     @echo ""
  97.     @echo "Current Makefile configuration is to compile the following"
  98.     @echo "architectures:  $(ARCHITECTURES)"
  99.     
  100. all: lib bundles examples palettes debug
  101.  
  102. lib:
  103.     @(if test $(SHOWREADME) = YES; then open README.rtf; fi)&
  104.     @(if test $(AUDIOALERTS) = YES; then sndplay Makefiles/MiscBuild.snd; fi)&
  105.     @echo "************ Library ************"
  106.     @(cd Source; make all "TARGET_ARCHS=$(ARCHITECTURES)"; )
  107.     @for i in $(SUBLIBRARIES) none ; do \
  108.         if [ $$i = none ] ; then continue; fi; \
  109.         echo "*** Making $$i sub-library" ; \
  110.         (cd Source/$$i; make all "TARGET_ARCHS=$(ARCHITECTURES)"; mv *.a ..) ; \
  111.     done ;
  112.  
  113. debug:
  114.     @echo "************ Debug Library ************"
  115.     @(cd Source; make debug "TARGET_ARCHS=$(ARCHITECTURES)"; )
  116.     @for i in $(SUBLIBRARIES) none ; do \
  117.         if [ $$i = none ] ; then continue; fi; \
  118.         echo "*** Making $$i sub-library" ; \
  119.         (cd Source/$$i; make debug "TARGET_ARCHS=$(ARCHITECTURES)"; mv *.a ..) ; \
  120.     done ;
  121.  
  122. bundles:
  123.     @echo "************ Bundles ************"
  124.     @for i in $(BUNDLES) none ; do \
  125.         if [ $$i = none ] ; then continue; fi; \
  126.         echo "*** Making $$i class bundle" ; \
  127.         (cd Bundles/$$i; make "TARGET_ARCHS=$(ARCHITECTURES)"; ) ; \
  128.     done ;
  129.  
  130. examples: lib bundles
  131.     @echo "************ Examples ************"
  132.     @for i in $(TESTAPP_EXAMPLES) none ; do \
  133.         if [ $$i = none ] ; then continue; fi; \
  134.         echo "*** Making $$i test app" ; \
  135.         (cd Examples/$$i; make "TARGET_ARCHS=$(ARCHITECTURES)"; ) ; \
  136.     done ;
  137.     @for i in $(EXAMPLEAPP_EXAMPLES) none ; do \
  138.         if [ $$i = none ] ; then continue; fi; \
  139.         echo "*** Making $$i example app" ; \
  140.         (cd Examples/$$i; make "TARGET_ARCHS=$(ARCHITECTURES)"; ) ; \
  141.     done ;
  142.     
  143. palettes: bundles
  144.     @echo "************ Palettes ************"
  145.     @for i in $(PALETTES) none ; do \
  146.         if [ $$i = none ] ; then continue; fi; \
  147.         echo "*** Making $$i palette" ; \
  148.         (cd Palettes/$$i; make "TARGET_ARCHS=$(ARCHITECTURES)"; ) ; \
  149.     done ;
  150.  
  151. install: lib palettes
  152.     @echo "************ Installing $(NAME) ************"
  153.     @echo "*** Installing libraries to $(LIB_INSTALL)"
  154.     mkdirs $(LIB_INSTALL) $(OLD_LIB_INSTALL)
  155.     (cd Source; tar -cf - lib*.a | (cd $(LIB_INSTALL); tar -xf - ;))
  156.     (cd $(OLD_LIB_INSTALL); rm -rf lib*misckit*.a ; \
  157.                 ln -s $(LIB_INSTALL)/libMiscKit.a libmisckit.a; \
  158.                 ln -s $(LIB_INSTALL)/libMiscKit_g.a libmisckit_g.a; \
  159.                 ln -s $(LIB_INSTALL)/libMiscKit.a libdaymisckit.a; \
  160.                 ln -s $(LIB_INSTALL)/libMiscKit_g.a libdaymisckit_g.a; )
  161.     for i in $(PALETTES_WITH_LIBS) none ; do \
  162.         if [ $$i = none ] ; then continue; fi; \
  163.         (cd Palettes/$$i; tar -cf - *.a | \
  164.                 (cd $(LIB_INSTALL); tar -xf - ;)) ; \
  165.     done ;
  166.     @echo "*** Installing headers to $(HEADER_INSTALL)"
  167.     mkdirs $(HEADER_INSTALL)
  168.     (cd Headers; tar -cf - * | (cd $(HEADER_INSTALL); tar -xf - ;))
  169.     for i in $(PALETTES_WITH_LIBS) none ; do \
  170.         if [ $$i = none ] ; then continue; fi; \
  171.          (cd Palettes/$$i/*.subproj; cp *.h $(HEADER_INSTALL)/misckit; ) \
  172.     done ;
  173. # build the precomp header
  174.     (cd $(HEADER_INSTALL)/misckit; cc -O -g -Wall -ObjC -I$(HEADER_INSTALL) \
  175.                 -precomp $(ARCH_FLAGS) misckit.h -o misckit.p)
  176.     @echo "*** Installing documentation to $(DOC_INSTALL)"
  177.     rm -rf $(DOC_INSTALL)
  178.     mkdirs $(DOC_INSTALL)
  179.     (cd Documentation; tar -cf - * .??* | (cd $(DOC_INSTALL); tar -xf - ;))
  180.     @echo "*** Building index for documentation ***
  181.     ixbuild -cs $(DOC_INSTALL)
  182.     @echo "*** Installing palettes to $(PALETTE_INSTALL)"
  183.     mkdirs $(PALETTE_INSTALL)
  184. # this is inefficient speed-wise, but makes for smaller palettes than the
  185. # tar method because it strips them.  Installs only happen once, and the
  186. # saved space is significant, so we'll take the hit.
  187.     for i in $(PALETTES) none ; do \
  188.         if [ $$i = none ] ; then continue; fi; \
  189.          (cd Palettes/$$i; make install INSTALLDIR=$(PALETTE_INSTALL) \
  190.             "TARGET_ARCHS=$(ARCHITECTURES)"; ) \
  191.     done ;
  192.     @echo "*** Installing example source code to $(EXAMPLE_SRC_INSTALL)"
  193.     mkdirs $(EXAMPLE_SRC_INSTALL)
  194.     (cd Examples; tar -chf - $(EXAMPLEAPP_EXAMPLES) $(EXAMPLEOTHERS) .??* | \
  195.                 (cd $(EXAMPLE_SRC_INSTALL); tar -xf - ;))
  196.     @(if test $(AUDIOALERTS) = YES; then sndplay Makefiles/MiscFinish.snd; fi)&
  197.  
  198. uninstall:
  199.     @echo "************ Uninstalling $(NAME) ************"
  200.     rm -rf $(LIB_INSTALL)/libMisc*.a $(OLD_LIB_INSTALL)/lib*misckit*.a \
  201.                 $(HEADER_INSTALL)/misckit \
  202.                 $(HEADER_INSTALL)/daymisckit \
  203.                 $(HEADER_INSTALL)/ExtendedApp.h \
  204.                 $(PALETTE_INSTALL)/Misc*.palette \
  205.                 $(DOC_INSTALL) $(EXAMPLE_SRC_INSTALL)
  206.     
  207. distclean:
  208.     @echo "************ Cleaning for distribution ************"
  209.     @(cd Source; make clean; )
  210.     @for i in $(SUBLIBRARIES) none ; do \
  211.         if [ $$i = none ] ; then continue; fi; \
  212.         (cd Source/$$i; make clean; ) \
  213.     done ;
  214.     @(cd Headers/misckit; rm -rf *.p; )
  215.     @for i in $(BUNDLES) none ; do \
  216.         if [ $$i = none ] ; then continue; fi; \
  217.         (cd Bundles/$$i; make clean; ) \
  218.     done ;
  219.     @for i in $(PALETTES) none ; do \
  220.         if [ $$i = none ] ; then continue; fi; \
  221.         (cd Palettes/$$i; make clean; ) \
  222.     done ;
  223.     @for i in $(TESTAPP_EXAMPLES) none ; do \
  224.         if [ $$i = none ] ; then continue; fi; \
  225.         (cd Examples/$$i; make clean; ) \
  226.     done ;
  227.     @for i in $(EXAMPLEAPP_EXAMPLES) none ; do \
  228.         if [ $$i = none ] ; then continue; fi; \
  229.         (cd Examples/$$i; make clean; ) \
  230.     done ;
  231. # get rid of those pesky .dir3_0.wmd files, but keep the top level one.
  232.     @cp .dir3_0.wmd .dir3_0.wmd~
  233.     find ./ -name .dir3_0.wmd -print | xargs rm -f
  234.     @cp .dir3_0.wmd~ .dir3_0.wmd
  235.     @rm .dir3_0.wmd~
  236.