home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / adav313.zip / gnat-3_13p-os2-bin-20010916.zip / emx / gnat / examples / Makefile < prev    next >
Makefile  |  2001-09-02  |  2KB  |  134 lines

  1. #-----------------------------------------------------------------------------
  2. #                               EXAMPLES  Makefile
  3. #-----------------------------------------------------------------------------
  4.  
  5. # the C compiler
  6. CC = gcc
  7.  
  8. # the Ada Compiler
  9. ADAC = $(CC)
  10.  
  11. # the C++ compiler
  12. CPLUSPLUS = gcc
  13. STDC = stdcpp
  14.  
  15. # Gnat1 compilation flags
  16. GF = -O2 -largs -L\emx\lib\st
  17.  
  18. # Gnatbind binder flags
  19. BF =
  20.  
  21. # Extension for ".o" files
  22. o = o
  23.  
  24. # Extension for executable files
  25. e =
  26.  
  27. LIST_EXEC = \
  28.   hello$e \
  29.   text_io_example$e \
  30.   use_of_import$e   \
  31.   tgef$e            \
  32.   tef$e             \
  33.   demo1$e           \
  34.   demo2$e           \
  35.   test_cl$e         \
  36.   diners$e          \
  37.   ex6_main          \
  38.   cpp_main
  39.  
  40.  
  41. #-----------------------------------------------------------------------------
  42. # Main rule
  43.  
  44. all : clean $(LIST_EXEC) 
  45.  
  46. clean : force
  47.     @rm -f *.$o *.ali b_*.c *.s *~ $(LIST_EXEC)
  48.  
  49. force :
  50.  
  51. # hello
  52. ########
  53. hello$e:
  54.     gnatmake hello$e -cargs $(GF)
  55.     hello$e < hello.rsp
  56.  
  57. # text_io_example
  58. #################
  59. text_io_example$e:
  60.     gnatmake text_io_example$e -cargs $(GF)
  61.     text_io_example$e
  62.  
  63.  
  64. # use_of_import
  65. ###############
  66. use_of_import$e: imported_function.o
  67.     gnatmake use_of_import$e -cargs $(GF) -largs imported_function.o
  68.     use_of_import$e
  69.  
  70. # tgef
  71. ######
  72. tgef$e:
  73.     gnatmake tgef$e -cargs $(GF)
  74.     tgef$e
  75. # tef
  76. ######
  77. tef$e:
  78.     gnatmake tef$e -cargs $(GF)
  79.     tef$e
  80.  
  81. # demo1
  82. #######
  83. demo1$e:
  84.     gnatmake demo1$e -cargs $(GF)
  85.     demo1$e
  86.  
  87. # demo2
  88. #######
  89. demo2$e:
  90.     gnatmake demo2$e -cargs $(GF)
  91.     demo2$e < demo2.rsp
  92.  
  93. # test_cl
  94. #########
  95. test_cl$e: imported_function.$o
  96.     gnatmake test_cl -largs -L\emx\lib\st
  97.     test_cl arg1 arg2 arg3
  98.     @echo ""
  99.     test_cl a bb cccccc   d eeeeeee ff
  100.  
  101. # diners
  102. ########
  103. diners$e:
  104.     gnatmake diners$e -cargs $(GF)
  105.     diners$e
  106.  
  107. # ex6_main
  108. ##########
  109. ex6.o :
  110.     @echo -n "if c++ is not installed, the next command will fail"
  111.     $(CPLUSPLUS) -c ex6.C
  112.  
  113.  
  114. ex6_main$e: ex6.o
  115.     gnatmake ex6_main -cargs $(GF) -bargs -C -largs -C ex6.$o -l$(STDC) --GCC=$(CPLUSPLUS)
  116.     ex6_main$e
  117.  
  118. # cpp_main
  119. ##########
  120. ex7.o :
  121.     $(CPLUSPLUS) -c ex7.C
  122.  
  123. cpp_main.o :
  124.     $(CPLUSPLUS) -c cpp_main.C
  125.  
  126. cpp_main$e: ex7.o cpp_main.o
  127.     gnatmake -c simple_cpp_interface
  128.     gnatbind -n simple_cpp_interface
  129.     gnatlink simple_cpp_interface -o cpp_main --LINK=$(CPLUSPLUS) -l$(STDC) ex7.o cpp_main.o
  130.  
  131. .PHONY: clean force
  132.  
  133.  
  134.