makefile 4.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 Zynq Win32 Win64 Linux32 Linux64 Darwin32 Darwin64 Solaris32 Solaris64 \
  8. RPiC ZynqC Linux32C Linux64C
  9. target := Linux64
  10. pltfrm := Unix64
  11. object := .Gof
  12. symbol := .Sym
  13. # module dependencies
  14. modules: source/Release.Tool
  15. @AOSPATH=source ./original Release.Build --list $(target) | tr -d '\r' | grep "^[^ ]\+\.Mod\s" | tr -d ' ' > $@
  16. dependencies: modules source/*.Mod
  17. @./original DependencyWalker.Walk --define=UNIX,AMD64 --fileExtension=$(object) $(addprefix source/, $(shell sort -u modules)) DependencyWalker.Mod | tr -d '\r' | grep "^.\+\$(object):" > $@
  18. -include dependencies
  19. FoxArrayBase$(object): ComplexNumbers$(object)
  20. %$(object):
  21. @$(tool) Compiler.Compile -p=$(pltfrm) --objectFileExtension=$(object) --symbolFileExtension=$(symbol) $(if $<, $<, $(error no target for $@))
  22. # Fox Compiler
  23. 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 FoxGenericObjectFile FoxCodeGenerators FoxAMDBackend FoxDisassembler FoxARMInstructionSet FoxAssembler FoxARMAssembler FoxARMBackend MathL Math ComplexNumbers FoxArrayBase FoxArrayBaseOptimized Localization Repositories UnicodeProperties TextUtilities TestSuite Versioning CompilerInterface FoxTest Linker DependencyWalker ReleaseThreadPool Zlib ZlibBuffers ZlibInflate ZlibReaders ZlibDeflate ZlibWriters Zip Release)
  24. @$(tool) Linker.Link -p=$(target) --fileName=$@ $+ && chmod +x $@
  25. # grep ":processing\s$" oberon.log | grep "^[^:]\+" -o | tr '\n' ' '
  26. Self\ Compilation: $(addsuffix $(object), Compiler CompilerInterface FoxA2Interface FoxActiveCells FoxAMD64Assembler FoxAMD64InstructionSet FoxAMDBackend FoxARMAssembler FoxARMBackend FoxARMInstructionSet FoxArrayBase FoxArrayBaseOptimized FoxAssembler FoxBackend FoxBasic FoxBinaryCode FoxCodeGenerators 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 FoxTextualSymbolFile FoxTranspilerBackend FoxTRMAssembler FoxTRMBackend FoxTRMInstructionSet TextCompiler)
  27. # grep "^\(Fox\|Compiler\|TextCompiler\)" modules | sed 's/\.Mod//g' | sort | tr '\n' ' '
  28. Compilation\ Tests: Oberon.Compilation.Test.Diff
  29. Oberon.Compilation.Test.Diff: oberon source/Oberon.Compilation.Test
  30. @./oberon FoxTest.Compile source/Oberon.Compilation.Test
  31. Execution\ Tests: Oberon.Execution.Test.Diff
  32. Oberon.Execution.Test.Diff: oberon source/Oberon.Execution.Test
  33. @./oberon FoxTest.Compile --prolog=\"Compiler.Compile --symbolFileExtension=$(symbol) TesterInput.txt\" source/Oberon.Execution.Test
  34. # A2 Builds
  35. builds:
  36. @make $(foreach platform,$(platforms),&& make build platform=$(platform))
  37. ifdef platform
  38. build: $(if $(filter $(platforms), $(platform)), $(platform), $(error invalid platform))
  39. $(platform): oberon source/Release.Tool $(addprefix source/, $(shell AOSPATH=source ./original Release.Build --list $(platform) | tr -d '\r' | grep "^[^ ]\+\.Mod\s" | tr -d ' '))
  40. @rm -rf $@ && mkdir $@
  41. @AOSPATH=source ./oberon Release.Build --path=$@/ --build $(platform) || (rm -rf $@ && false)
  42. else
  43. build:
  44. $(error undefined platform)
  45. endif
  46. # utilities
  47. original: oberon
  48. @cp oberon $@
  49. clean:
  50. @rm -f modules dependencies oberon *$(symbol) *$(object) *.Log *.log
  51. @rm -rf $(platforms)