home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gnu / examples / makefile < prev    next >
Encoding:
Makefile  |  1996-01-30  |  1.9 KB  |  89 lines

  1. #-----------------------------------------------------------------------------
  2. #                               EXAMPLES  Makefile
  3. #-----------------------------------------------------------------------------
  4. #
  5. # Do not modify this file.  If you want to add a new example, modify the file
  6. # Makefile.dep.
  7. #-----------------------------------------------------------------------------
  8.  
  9. # the C compiler
  10. CC = gcc
  11.  
  12. # the Ada Compiler
  13. ADAC = $(CC)
  14.  
  15. # the C++ compiler
  16. CPLUSPLUS = gcc
  17.  
  18. # Gnat1 compilation flags
  19. GF =
  20.  
  21. # Gnatbind binder flags
  22. BF =
  23.  
  24. # Extension for ".o" files
  25. o = o
  26.  
  27. # Extension for executable files
  28. e =
  29.  
  30.  
  31. #-----------------------------------------------------------------------------
  32. # Main rule
  33.  
  34. main_rule : process
  35.  
  36. include Makefile.dep
  37.  
  38. process : clean $(LIST_EXEC) announce
  39.  
  40. ###############################################################################
  41. # General rules
  42. ###############################################################################
  43. .SUFFIXES: .adb .ads .ali .o
  44. .PHONY: clean process announce force
  45.  
  46. .adb.o:
  47.     $(ADAC) -c $(GF)  $<
  48.  
  49. .ads.o:
  50.     $(ADAC) -c $(GF)  $<
  51.  
  52. .c.o:
  53.     $(CC) -c $(CFLAGS) $<
  54.  
  55. % : %.o
  56.     gnatbl $@.ali $($@_DEP)
  57.     ./$@
  58.  
  59. clean : force
  60.     @rm -f *.$o *.ali b_*.c *.s *~ $(LIST_EXEC) *.exe
  61.  
  62. announce :
  63.     @echo " "
  64.     @echo "ANNOUNCES:
  65.     @echo "   * Warning for users of package IO: "
  66.     @echo "     IO has been transformed into Gnat.IO, change your programs..."
  67.     @echo " "
  68.     @echo "   * if you are interested by the C++ interface: try 'make ex6_main'"
  69.     @echo " "
  70.  
  71. force :
  72.  
  73. ##############################################################################
  74. # special stuff for the c++ interface
  75. ##############################################################################
  76.  
  77. ex6.o :
  78.     @echo -n "if g++ is not installed on your standard 'gcc', the next "
  79.     @echo "command will fail"
  80.     $(CPLUSPLUS) -c ex6.C
  81.  
  82.  
  83. ex6_main$e: ex6_main.$o ex6_if.$o $(ex6_main_DEP)
  84.     gnatbl ex6_main.ali ex6.$o -lg++
  85.     ./ex6_main$e
  86.  
  87.  
  88.  
  89.