makefile 4.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. all: oberon
  2. commit: Self\ Compilation Compilation\ Tests Execution\ Tests builds
  3. .PHONY: all commit Self\ Compilation Compilation\ Tests Execution\ Tests builds build clean
  4. MAKEFLAGS += --no-builtin-rules --no-builtin-variables
  5. .SUFFIXES: # delete the default suffixes
  6. tool := $(if $(wildcard oberon), ./oberon, ./original)
  7. platforms := Bios32 Bios64 Win32 Win64 Linux32 Linux64 Darwin32 Darwin64 Solaris32 Solaris64 \
  8. Linux64C
  9. target := Linux64
  10. object := .GofUu
  11. symbol := .SymUu
  12. # module dependencies
  13. modules: source/Release.Tool
  14. @AOSPATH=source ./original Release.Build --list $(target) | tr -d '\r' | grep "^[^ ]\+\.Mod\s" | tr -d ' ' > $@
  15. dependencies: modules source/*.Mod
  16. @./original DependencyWalker.Walk --fileExtension=$(object) $(addprefix source/, $(shell sort -u modules)) DependencyWalker.Mod | tr -d '\r' | grep "^.\+\$(object):" > $@
  17. -include dependencies
  18. FoxArrayBase$(object): ComplexNumbers$(object)
  19. %$(object):
  20. @$(tool) compile -p=$(target) $(if $<, $<, $(error no target for $@))
  21. # Fox Compiler
  22. oberon: $(addsuffix $(object), Builtins Trace Glue Unix Machine Heaps Modules Objects Streams Kernel Reflection KernelLog TrapWriters Commands Pipes StdIO Traps Files UnixFiles BitSets StringPool ObjectFile Diagnostics Reals Clock Dates Strings GenericLinker Loader WMRectangles CLUTs Plugins Displays Raster UTF8Strings WMRasterScale SoundDevices XMLObjects DynamicStrings XML XMLScanner XMLParser Configuration Inflate CRC Unzip WMEvents Locks FP1616 Texts Archives Codecs WMGraphics WMDefaultFont StdIOShell Shell Options ProcessInfo0 ProcessInfo SystemVersion System Debugging FoxBasic FoxScanner FoxSyntaxTree FoxGlobal FoxParser FoxFingerPrinter FoxPrintout FoxFormats FoxSemanticChecker FoxBackend FoxFrontend Compiler FoxOberonFrontend FoxSections FoxBinaryCode FoxIntermediateCode FoxInterfaceComparison FoxTextualSymbolFile FoxIntermediateBackend FoxAMD64InstructionSet FoxAMD64Assembler FoxCodeGenerators FoxAMDBackend FoxGenericObjectFile Math MathL ComplexNumbers FoxArrayBase FoxArrayBaseOptimized Linker DependencyWalker Localization Repositories UnicodeProperties TextUtilities ReleaseThreadPool Zlib ZlibBuffers ZlibInflate ZlibReaders ZlibDeflate ZlibWriters Zip CompilerInterface Release)
  23. @$(tool) Linker.Link -p=$(target) --fileName=$@ Builtins Traps UnixFiles Loader WMDefaultFont StdIOShell Shell System Compiler FoxOberonFrontend FoxAMDBackend FoxArrayBase FoxArrayBaseOptimized Linker DependencyWalker Release && chmod +x $@
  24. # grep ":processing\s$" oberon.log | grep "^[^:]\+" -o | tr '\n' ' '
  25. Self\ Compilation: $(addsuffix $(object), FoxA2Interface FoxActiveCells FoxAMD64Assembler FoxAMD64InstructionSet FoxAMDBackend FoxARMAssembler FoxARMBackend FoxARMInstructionSet FoxArrayBase FoxArrayBaseOptimized FoxAssembler FoxBackend FoxBasic FoxBinaryCode FoxCodeGenerators Compiler FoxCSharpFrontend FoxCSharpParser FoxCSharpScanner FoxDisassembler FoxDocumentationBackend FoxDocumentationHtml FoxDocumentationParser FoxDocumentationPrinter FoxDocumentationScanner FoxDocumentationTree FoxFingerPrinter FoxFormats FoxFrontend FoxGenericObjectFile FoxGlobal FoxHardware FoxInterfaceComparison FoxIntermediateAssembler FoxIntermediateBackend FoxIntermediateCode FoxIntermediateLinker FoxIntermediateObjectFile FoxIntermediateParser FoxInterpreterBackend FoxMinosObjectFile FoxOberonFrontend FoxParser FoxPrintout FoxProfiler FoxProgTools FoxScanner FoxSections FoxSemanticChecker FoxSyntaxTree FoxTest TextCompiler FoxTextualSymbolFile FoxTranspilerBackend FoxTRMAssembler FoxTRMBackend FoxTRMInstructionSet)
  26. # grep "^Fox" modules | sed 's/\.Mod//g' | tr '\n' ' '
  27. Compilation\ Tests: Oberon.Compilation.Test.Diff
  28. Oberon.Compilation.Test.Diff: oberon FoxTest$(object) source/Oberon.Compilation.Test
  29. @./oberon FoxTest.Compile source/Oberon.Compilation.Test
  30. Execution\ Tests: Oberon.Execution.Test.Diff
  31. Oberon.Execution.Test.Diff: oberon FoxTest$(object) source/Oberon.Execution.Test
  32. @./oberon FoxTest.Compile source/Oberon.Execution.Test
  33. # A2 Builds
  34. builds:
  35. @make $(foreach platform,$(platforms),&& make build platform=$(platform))
  36. ifdef platform
  37. build: $(if $(filter $(platforms), $(platform)), $(platform), $(error invalid platform))
  38. $(platform): oberon source/Release.Tool $(addprefix source/, $(shell AOSPATH=source ./original Release.Build --list $(platform) | tr -d '\r' | grep "^[^ ]\+\.Mod\s" | tr -d ' '))
  39. @rm -rf $@ && mkdir $@
  40. @AOSPATH=source ./oberon Release.Build --path=$@/ --build $(platform) || (rm -rf $@ && false)
  41. else
  42. build:
  43. $(error undefined platform)
  44. endif
  45. # utilities
  46. original: oberon
  47. @cp oberon $@
  48. clean:
  49. @rm -f modules dependencies oberon *$(symbol) *$(object) *.Log *.log
  50. @rm -rf $(platforms)