home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume27 / distributed-c-2.1 / part04 / Makefile
Encoding:
Makefile  |  1993-12-22  |  5.0 KB  |  183 lines

  1. #***************************************************************************
  2. #*                                                                         *
  3. #* @@@@  @@@ @@@@@ @@@@@ @@@@@ @@@ @@@@  @   @ @@@@@ @@@@@ @@@@       @@@  *
  4. #* @   @  @  @       @   @   @  @  @   @ @   @   @   @     @   @     @   @ *
  5. #* @   @  @  @@@@@   @   @@@@@  @  @@@@@ @   @   @   @@@@@ @   @     @     *
  6. #* @   @  @      @   @   @ @    @  @   @ @   @   @   @     @   @     @   @ *
  7. #* @@@@  @@@ @@@@@   @   @  @  @@@ @@@@  @@@@@   @   @@@@@ @@@@       @@@  *
  8. #*                                                                         *
  9. #*              A compiler for distributed programming with C              *
  10. #*                                                                         *
  11. #*                           M a k e f i l e                               *
  12. #*                                                                         *
  13. #*                 Version 1.0      CreationDate: 05.07.90                 *
  14. #*                                    LastUpDate: 06.12.93                 *
  15. #*                                                                         *
  16. #*                     The main makefile to build all.                     *
  17. #*                                                                         *
  18. #*              Copyright (C) 1990-1994 by Christoph Pleier.               *
  19. #*                          All rights reserved!                           *
  20. #***************************************************************************/
  21.  
  22. SHELL = /bin/sh
  23. MAKE  = make
  24. RM    = \rm
  25.  
  26. # The makros for archiving the source
  27. COMPRESS    = gzip -f
  28. UNCOMPRESS  = gzip -d
  29. COMPRESSEXT = .gz
  30. ARCFILE     = dcde.tar
  31. ARCDIR      = DISTRIBUTED_C
  32. BACKUPDEV   = /dev/fd0
  33.  
  34. # The directories that have to be cleaned
  35. CLEANDIRS = dcadmin dcc dckill dcinstall dclocate dcanalyse examples ipc \
  36.         lib config
  37.  
  38. # Include target system specific macros
  39. include macros
  40.  
  41. default:
  42.     @cat Makefile.msg Makefile.doc
  43.  
  44. iPSC:
  45.     -$(RM) -f macros
  46.     @ln macros.iPSC macros
  47.     @touch include/config.h
  48.     $(MAKE) all
  49.  
  50. AIX:
  51.     -$(RM) -f macros
  52.     @ln macros.AIX macros
  53.     @touch include/config.h
  54.     $(MAKE) all
  55.  
  56. CONVEX:
  57.     -$(RM) -f macros
  58.     @ln macros.CONVEX macros
  59.     @touch include/config.h
  60.     $(MAKE) all
  61.  
  62. UNICOS:
  63.     -$(RM) -f macros
  64.     @ln macros.UNICOS macros
  65.     @touch include/config.h
  66.     $(MAKE) all
  67.  
  68. HPUX:
  69.     -$(RM) -f macros
  70.     @ln macros.HPUX macros
  71.     @touch include/config.h
  72.     $(MAKE) all
  73.  
  74. LINUX:
  75.     -$(RM) -f macros
  76.     @ln macros.LINUX macros
  77.     @touch include/config.h
  78.     $(MAKE) all
  79.  
  80. SPARC:
  81.     -$(RM) -f macros
  82.     @ln macros.SPARC macros
  83.     @touch include/config.h
  84.     $(MAKE) all
  85.  
  86. ULTRIX:
  87.     -$(RM) -f macros
  88.     @ln macros.ULTRIX macros
  89.     @touch include/config.h
  90.     $(MAKE) all
  91.  
  92. UNIX:
  93.     -$(RM) -f macros
  94.     @ln macros.UNIX macros
  95.     @touch include/config.h
  96.     $(MAKE) all
  97.  
  98. XENIX:
  99.     -$(RM) -f macros
  100.     @ln macros.XENIX macros
  101.     @touch include/config.h
  102.     $(MAKE) all
  103.  
  104. all:
  105.     @cat Makefile.msg
  106.     @echo "Generating all ($(MAKEDIRS))..."
  107.     for name in $(MAKEDIRS); \
  108.     do \
  109.         echo ""; \
  110.         cd $${name}; \
  111.         $(MAKE);\
  112.         cd ..; \
  113.     done 
  114.     @echo ""
  115.     @echo all done!
  116.  
  117. install:
  118.     @cat Makefile.msg
  119.     @echo "Installing the Distributed C Package ..."
  120.     -mkdir $(INSTALLDIR)
  121.     -mkdir $(INSTALLDIR)/include
  122.     -mkdir $(INSTALLDIR)/lib
  123.     -mkdir $(INSTALLDIR)/bin
  124.     cp include/*.h $(INSTALLDIR)/include
  125.     chmod a+r $(INSTALLDIR)/include/*
  126.     cp lib/*.c $(INSTALLDIR)/lib
  127.     chmod a+r $(INSTALLDIR)/lib/*
  128.     -\rm -f $(INSTALLDIR)/bin/dcc \
  129.         $(INSTALLDIR)/bin/dcadmin \
  130.         $(INSTALLDIR)/bin/dcinstall \
  131.         $(INSTALLDIR)/bin/killdcadmins \
  132.         $(INSTALLDIR)/bin/dckill
  133.     cp dcc/dcc $(INSTALLDIR)/bin/dcc 
  134.     cp dcadmin/dcadmin $(INSTALLDIR)/bin/dcadmin
  135.     cp dcinstall/dcinstall $(INSTALLDIR)/bin/dcinstall
  136.     cp bin/killdcadmins $(INSTALLDIR)/bin/killdcadmins
  137.     -cp dckill/dckill $(INSTALLDIR)/bin/dckill
  138.     chmod a+r $(INSTALLDIR)/bin/*
  139.     chmod a-w $(INSTALLDIR)/bin/*
  140.     @echo package installed!
  141.  
  142. contents:
  143.     @echo "Building the CONTENTS file ..."
  144.     -$(RM) -f CONTENTS
  145.     echo "The Distributed C package consists of the following files:" > CONTENTS
  146.     echo " " >> CONTENTS
  147.     ls -lR * >> CONTENTS
  148.     @echo CONTENTS file built!
  149.  
  150. clean:
  151.     @echo "Cleaning the subdirectories ..."
  152.     for name in $(CLEANDIRS); \
  153.     do \
  154.         echo "***** Cleaning the directory '$${name}'"; \
  155.         cd $${name}; \
  156.         $(MAKE) -s clean; \
  157.         cd ..; \
  158.     done 
  159.     @echo directories cleaned!
  160.     -find . -name core -exec rm {} \;
  161.     -find . -name "*.bak" -exec rm -f {} \;
  162.     -find . -name "*.BAK" -exec rm -f {} \;
  163.     -find . -name "*.debug" -exec rm -f {} \;
  164.  
  165. archive:
  166.     $(MAKE) clean
  167.     $(MAKE) contents
  168.     @echo ""
  169.     @echo "Archiving the Distributed C Package..."
  170.     -\mv ../$(ARCFILE)$(COMPRESSEXT) ../$(ARCFILE)$(COMPRESSEXT).bak
  171.     ( cd .. ; tar cf $(ARCFILE) $(ARCDIR) ; $(COMPRESS) $(ARCFILE) )
  172.     @echo "Checking archive file for errors..."
  173.     ( cd .. ; cat $(ARCFILE)$(COMPRESSEXT) | $(UNCOMPRESS) | tar tvf - )
  174.     @echo Package correctly archived!
  175.  
  176. backup:
  177.     $(MAKE) archive
  178.     @echo "Insert a disk in device $(BACKUPDEV) and press RETURN!"
  179.     @read $dummy
  180.     @echo "Backing data up..."
  181.     ( cd .. ; tar cvf $(BACKUPDEV) $(ARCFILE)$(COMPRESSEXT); tar tvf $(BACKUPDEV) )
  182.     @echo data backup completed!
  183.