/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/Makefile

http://github.com/icsharpcode/ILSpy · Makefile · 126 lines · 82 code · 34 blank · 10 comment · 6 complexity · b0b16dfa582620a3246e0cb57fdf68aa MD5 · raw file

  1. thisdir := mcs
  2. SUBDIRS :=
  3. include ../build/rules.make
  4. EXTRA_DISTFILES = \
  5. *mcs.csproj \
  6. compiler.doc \
  7. *mcs.sln \
  8. *cs-parser.jay \
  9. *.sources \
  10. NOTES \
  11. TODO \
  12. *mcs.exe.config
  13. COMPILER_NAME = gmcs
  14. ifeq (net_2_0, $(PROFILE))
  15. INTERNAL_GMCS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BOOTSTRAP_PROFILE)/gmcs.exe
  16. endif
  17. ifeq (moonlight_bootstrap, $(PROFILE))
  18. INTERNAL_GMCS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BOOTSTRAP_PROFILE)/gmcs.exe
  19. endif
  20. ifeq (2.1, $(FRAMEWORK_VERSION))
  21. LOCAL_MCS_FLAGS += -d:SMCS_SOURCE
  22. COMPILER_NAME = smcs
  23. endif
  24. ifeq (4.0, $(FRAMEWORK_VERSION))
  25. COMPILER_NAME = dmcs
  26. endif
  27. PROGRAM = $(topdir)/class/lib/$(PROFILE)/$(COMPILER_NAME).exe
  28. BUILT_SOURCES = cs-parser.cs
  29. PROGRAM_COMPILE = $(BOOT_COMPILE)
  30. CLEAN_FILES += y.output
  31. %-parser.cs: %-parser.jay $(topdir)/jay/skeleton.cs
  32. $(topdir)/jay/jay -cvt < $(topdir)/jay/skeleton.cs $< > jay-tmp.out && mv jay-tmp.out $@
  33. KEEP_OUTPUT_FILE_COPY = yes
  34. include ../build/executable.make
  35. csproj-local:
  36. config_file=`basename $(PROGRAM) .exe`-$(PROFILE).input; \
  37. echo $(thisdir):$$config_file >> $(topdir)/../mono/msvc/scripts/order; \
  38. (echo $(is_boot); \
  39. echo $(BOOTSTRAP_MCS); \
  40. echo $(USE_MCS_FLAGS) $(LIBRARY_FLAGS) $(LIB_MCS_FLAGS); \
  41. echo $(PROGRAM); \
  42. echo $(BUILT_SOURCES); \
  43. echo $(PROGRAM); \
  44. echo $(response)) > $(topdir)/../mono/msvc/scripts/inputs/$$config_file
  45. #
  46. # Below this line we have local targets used for testing and development
  47. #
  48. # Testing targets
  49. TIME = time
  50. # This used to be called test, but that conflicts with the global
  51. # recursive target.
  52. btest: mcs2.exe mcs3.exe
  53. ls -l mcs2.exe mcs3.exe
  54. mcs2.exe: $(PROGRAM)
  55. $(TIME) $(RUNTIME) $(RUNTIME_FLAGS) $(PROGRAM) $(USE_MCS_FLAGS) -target:exe -out:$@ $(BUILT_SOURCES) @$(response)
  56. mcs3.exe: mcs2.exe
  57. $(TIME) $(RUNTIME) $(RUNTIME_FLAGS) ./mcs2.exe $(USE_MCS_FLAGS) -target:exe -out:$@ $(BUILT_SOURCES) @$(response)
  58. wc:
  59. wc -l $(BUILT_SOURCES) `cat $(sourcefile)`
  60. ctest:
  61. rm -f mcs2.exe mcs3.exe
  62. $(MAKE) USE_MCS_FLAGS="-d:NET_1_1 -d:ONLY_1_1" btest
  63. # we need this because bash tries to use its own crappy timer
  64. FRIENDLY_TIME = $(shell which time) -f'%U seconds'
  65. do-time : $(PROGRAM)
  66. @ echo -n "Run 1: "
  67. @ rm -f mcs2.exe
  68. @ $(MAKE) TIME="$(FRIENDLY_TIME)" mcs2.exe > /dev/null || (echo FAILED; exit 1)
  69. @ echo -n "Run 2: "
  70. @ rm -f mcs3.exe
  71. @ $(MAKE) TIME="$(FRIENDLY_TIME)" mcs3.exe > /dev/null || (echo FAILED; exit 1)
  72. @ $(MAKE) do-corlib
  73. do-corlib:
  74. @ echo -n "corlib: "
  75. @ rm -f ../class/lib/mscorlib.dll
  76. @ cd ../class/corlib ; $(MAKE) BOOTSTRAP_MCS='$(FRIENDLY_TIME) mono $$(topdir)/class/lib/$(PROFILE)/mcs.exe' > /dev/null || (echo FAILED; exit 1)
  77. PROFILER=default
  78. do-gettext:
  79. xgettext --keyword='Report.Error:3' --keyword='Report.Error:2' --keyword='Report.Warning:3' --keyword='Report.Warning:2' -o mcs.po --language='C#' `cat gmcs.exe.sources | grep -v /`
  80. profile : $(PROGRAM)
  81. $(RUNTIME) $(RUNTIME_FLAGS) --profile=$(PROFILER) $(PROGRAM) $(USE_MCS_FLAGS) -target:exe -out:mcs2.exe $(BUILT_SOURCES) @$(response)
  82. #
  83. # quick hack target, to quickly develop the gmcs compiler
  84. # Update manually.
  85. q: cs-parser.cs qh
  86. echo 'System.Console.WriteLine ("Hello");' | mono csharp.exe
  87. echo -e 'using System;\nConsole.WriteLine ("hello");' | mono csharp.exe
  88. echo -e '"foo" == "bar";' | mono csharp.exe
  89. echo -e 'var a = 1;\na + 2;' | mono csharp.exe
  90. echo -e 'int j;\nj = 1;' | mono csharp.exe
  91. echo -e 'var a = new int[]{1,2,3};\nfrom x in a select x;' | mono csharp.exe
  92. echo -e 'var a = from f in System.IO.Directory.GetFiles ("/tmp") where f == "passwd" select f;' | mono csharp.exe