diff --git a/Makefile b/Makefile index d125476..a00b2e2 100644 --- a/Makefile +++ b/Makefile @@ -20,8 +20,9 @@ EXT_BIN_LIBBZ2 = libbz2.a EXT_BIN_LIBLZ4 = liblz4.a PCRE2_DIR = $(EXT_DIR)pcre2_build/ PCRE2_HEADERS = $(PCRE2_DIR)pcre2.h -PCRE2_HEADERS_OUT_DIR = $(STD_DIR_OUT)include +PCRE2_HEADERS_OUT_DIR = $(STD_DIR_OUT)include/ LIBAR_DIR = $(EXT_DIR)libarchive/libarchive/ +LIBAR_HEADERS = $(wildcard $(LIBAR_DIR)*.h) LIBAR_HEADERS_OUT_DIR = $(STD_DIR_OUT)include/ STD_BIN_DEBUG = $(STD_BIN:.a=debug.a) RUN_BIN = libddpruntime.a @@ -82,111 +83,82 @@ CMAKE = cmake SHELL = /bin/bash .SHELLFLAGS = -o pipefail -c -.PHONY: all clean clean-outdir debug kddp stdlib stdlib-debug runtime runtime-debug test test-memory checkout-llvm llvm help test-complete test-with-optimizations coverage +.PHONY: all debug kddp ddp-setup stdlib-copies stdlib stdlib-debug runtime-copies runtime runtime-debug external-compile external external-headers clean-cmd clean-runtime clean-stdlib clean clean-outdir checkout-llvm llvm test-normal test-memory test-normal-memory test-sumtypes coverage test test-with-optimizations help -all: $(OUT_DIR) kddp runtime stdlib external ddp-setup ## compiles kdddp, the runtime, the stdlib and ddp-setup into the build/DDP/ directory +all: kddp runtime stdlib ddp-setup $(OUT_DIR)LICENSE $(OUT_DIR)README.md ## compiles kdddp, the runtime, the stdlib and ddp-setup into the build/DDP/ directory -debug: $(OUT_DIR) kddp runtime-debug stdlib-debug external ## same as all but the runtime and stdlib print debugging information +debug: kddp runtime-debug stdlib-debug ## same as all but the runtime and stdlib print debugging information -kddp: $(OUT_DIR) ## compiles kddp into build/DDP/bin/ +%/: + $(MKDIR) $@ + +kddp: $(KDDP_DIR_OUT) $(LIB_DIR_OUT) ## compiles kddp into build/DDP/bin/ @echo "building kddp" - cd $(CMD_DIR) ; '$(MAKE)' kddp + '$(MAKE)' -C $(CMD_DIR) kddp $(CP) $(KDDP_DIR)$(KDDP_BIN) $(KDDP_DIR_OUT)$(KDDP_BIN) $(KDDP_DIR_OUT)$(KDDP_BIN) dump-list-defs -o $(LIB_DIR_OUT)$(DDP_LIST_DEFS_NAME) $(DDP_LIST_DEFS_OUTPUT_TYPES) -ddp-setup: $(OUT_DIR) ## compiles ddp-setup into build/DDP/bin/ +ddp-setup: $(DDP_SETUP_DIR_OUT) ## compiles ddp-setup into build/DDP/bin/ @echo "building ddp-setup" - cd $(CMD_DIR) ; '$(MAKE)' ddp-setup + '$(MAKE)' -C $(CMD_DIR) ddp-setup $(CP) $(DDP_SETUP_DIR)$(DDP_SETUP_BIN) $(DDP_SETUP_DIR_OUT)$(DDP_SETUP_BIN) -stdlib: $(OUT_DIR) external ## compiles the stdlib and the Duden into build/DDP/lib/stdlib and build/DDP/Duden - @echo "building the ddp-stdlib" - cd $(STD_DIR) ; '$(MAKE)' - $(CP) $(STD_DIR)$(STD_BIN) $(LIB_DIR_OUT)$(STD_BIN) - $(CP) $(STD_DIR)include/ $(STD_DIR_OUT) - $(CP) $(STD_DIR)source/ $(STD_DIR_OUT) +stdlib-copies: $(STD_DIR_OUT) + $(CP) $(STD_DIR)include/ $(STD_DIR)source/ $(STD_DIR)Makefile $(STD_DIR_OUT) $(CP) $(STD_DIR)Duden/ $(OUT_DIR) - $(CP) $(STD_DIR)Makefile $(STD_DIR_OUT)Makefile -stdlib-debug: $(OUT_DIR) external ## same as stdlib but will print debugging information - @echo "building the ddp-stdlib in debug mode" - cd $(STD_DIR) ; '$(MAKE)' debug +stdlib: external stdlib-copies $(LIB_DIR_OUT) ## compiles the stdlib and the Duden into build/DDP/lib/stdlib and build/DDP/Duden + '$(MAKE)' -C $(STD_DIR) + $(CP) $(STD_DIR)$(STD_BIN) $(LIB_DIR_OUT)$(STD_BIN) + +stdlib-debug: external stdlib-copies $(LIB_DIR_OUT) ## same as stdlib but will print debugging information + '$(MAKE)' -C $(STD_DIR) debug $(CP) $(STD_DIR)$(STD_BIN_DEBUG) $(LIB_DIR_OUT)$(STD_BIN) - $(CP) $(STD_DIR)include/ $(STD_DIR_OUT) - $(CP) $(STD_DIR)source/ $(STD_DIR_OUT) - $(CP) $(STD_DIR)Duden/ $(OUT_DIR) - $(CP) $(STD_DIR)Makefile $(STD_DIR_OUT)Makefile -runtime: $(OUT_DIR) ## compiles the runtime into build/DDP/lib/stdlib - @echo "building the ddp-runtime" - cd $(RUN_DIR) ; '$(MAKE)' +runtime-copies: $(RUN_DIR_OUT) + $(CP) $(RUN_DIR)include/ $(RUN_DIR)source/ $(RUN_DIR)Makefile $(RUN_DIR_OUT) + +runtime: runtime-copies $(LIB_DIR_OUT) ## compiles the runtime into build/DDP/lib/stdlib + '$(MAKE)' -C $(RUN_DIR) $(CP) $(RUN_DIR)$(RUN_BIN) $(LIB_DIR_OUT)$(RUN_BIN) $(CP) $(RUN_BIN_MAIN_DIR)$(RUN_BIN_MAIN) $(LIB_DIR_OUT)$(RUN_BIN_MAIN) - $(CP) $(RUN_DIR)include/ $(RUN_DIR_OUT) - $(CP) $(RUN_DIR)source/ $(RUN_DIR_OUT) - $(CP) $(RUN_DIR)Makefile $(RUN_DIR_OUT)Makefile - -runtime-debug: $(OUT_DIR) ## same as runtime but prints debugging information - @echo "building the ddp-runtime in debug mode" - cd $(RUN_DIR) ; '$(MAKE)' debug - @echo copying $(RUN_DIR)$(RUN_BIN_DEBUG) to $(LIB_DIR_OUT)$(RUN_BIN) + +runtime-debug: runtime-copies $(LIB_DIR_OUT) ## same as runtime but prints debugging information + '$(MAKE)' -C $(RUN_DIR) debug $(CP) $(RUN_DIR)$(RUN_BIN_DEBUG) $(LIB_DIR_OUT)$(RUN_BIN) $(CP) $(RUN_BIN_MAIN_DIR)$(RUN_BIN_MAIN_DEBUG) $(LIB_DIR_OUT)$(RUN_BIN_MAIN) - $(CP) $(RUN_DIR)include/ $(RUN_DIR_OUT) - $(CP) $(RUN_DIR)source/ $(RUN_DIR_OUT) - $(CP) $(RUN_DIR)Makefile $(RUN_DIR_OUT)Makefile -external: $(OUT_DIR) +external-compile: @echo "building all external libraries" - cd $(EXT_DIR) ; '$(MAKE)' all - - # copy pcre2 - @$(call cp_if_exists,$(EXT_DIR)$(EXT_BIN_PCRE2),$(LIB_DIR_OUT)$(EXT_BIN_PCRE2)) - $(MKDIR) $(PCRE2_HEADERS_OUT_DIR) - @$(call cp_if_exists,$(PCRE2_HEADERS),$(PCRE2_HEADERS_OUT_DIR)) - - # copy libarchive - @$(call cp_if_exists,$(EXT_DIR)$(EXT_BIN_LIBAR),$(LIB_DIR_OUT)$(EXT_BIN_LIBAR)) - $(MKDIR) $(LIBAR_HEADERS_OUT_DIR) - @$(call cp_if_exists,$(LIBAR_DIR)*.h,$(LIBAR_HEADERS_OUT_DIR)) - - # copy libz - @$(call cp_if_exists,$(EXT_DIR)$(EXT_BIN_LIBZ),$(LIB_DIR_OUT)$(EXT_BIN_LIBZ)) - - # copy liblzma - @$(call cp_if_exists,$(EXT_DIR)$(EXT_BIN_LIBLZMA),$(LIB_DIR_OUT)$(EXT_BIN_LIBLZMA)) - - # copy libbz2 - @$(call cp_if_exists,$(EXT_DIR)$(EXT_BIN_LIBBZ2),$(LIB_DIR_OUT)$(EXT_BIN_LIBBZ2)) - - # copy liblz4 - @$(call cp_if_exists,$(EXT_DIR)$(EXT_BIN_LIBLZ4),$(LIB_DIR_OUT)$(EXT_BIN_LIBLZ4)) - - -$(OUT_DIR): LICENSE README.md ## creates build/DDP/, build/DDP/bin/, build/DDP/lib/, ... and copies the LICENSE and README.md - @echo "creating output directories" - $(MKDIR) $(OUT_DIR) - $(MKDIR) $(DDP_SETUP_DIR_OUT) - $(MKDIR) $(KDDP_DIR_OUT) - $(MKDIR) $(OUT_DIR)Duden/ - $(MKDIR) $(STD_DIR_OUT)include/ - $(MKDIR) $(STD_DIR_OUT)source/ - $(MKDIR) $(RUN_DIR_OUT)include/ - $(MKDIR) $(RUN_DIR_OUT)source/ + '$(MAKE)' -C $(EXT_DIR) + +external-headers: external-compile $(LIBAR_HEADERS_OUT_DIR) $(PCRE2_HEADERS_OUT_DIR) + $(CP) $(LIBAR_HEADERS) $(LIBAR_HEADERS_OUT_DIR) + $(CP) $(PCRE2_HEADERS) $(PCRE2_HEADERS_OUT_DIR) + +external: external-headers + $(CP) $(EXT_DIR)$(EXT_BIN_PCRE2) $(EXT_DIR)$(EXT_BIN_LIBAR) $(EXT_DIR)$(EXT_BIN_LIBZ) $(EXT_DIR)$(EXT_BIN_LIBLZMA) $(EXT_DIR)$(EXT_BIN_LIBBZ2) $(EXT_DIR)$(EXT_BIN_LIBLZ4) $(LIB_DIR_OUT) + +$(OUT_DIR)LICENSE: LICENSE $(OUT_DIR) $(CP) LICENSE $(OUT_DIR) + +$(OUT_DIR)README.md: README.md $(OUT_DIR) $(CP) README.md $(OUT_DIR) -clean: clean-outdir ## deletes everything produced by this Makefile - cd $(CMD_DIR) ; '$(MAKE)' clean - cd $(STD_DIR) ; '$(MAKE)' clean - cd $(RUN_DIR) ; '$(MAKE)' clean +clean-cmd: + '$(MAKE)' -C $(CMD_DIR) clean +clean-runtime: + '$(MAKE)' -C $(RUN_DIR) clean +clean-stdlib: + '$(MAKE)' -C $(STD_DIR) clean + +clean: clean-outdir clean-cmd clean-runtime clean-stdlib ## deletes everything produced by this Makefile clean-outdir: ## deletes build/DDP/ - @echo "deleting output directory" $(RM) $(OUT_DIR) clean-all: clean - cd $(EXT_DIR) ; '$(MAKE)' clean + '$(MAKE)' -C $(EXT_DIR) clean checkout-llvm: ## clones the llvm-project submodule # clone the submodule diff --git a/bauer.ast b/bauer.ast deleted file mode 100644 index a15d03f..0000000 --- a/bauer.ast +++ /dev/null @@ -1,405 +0,0 @@ -Der generierte Abstrakte Syntaxbaum ist fehlerhaft -(ImportStmt - (TypeDefDecl[Zeiger: Public(true)] = Zahl) - - (FuncDecl[C_Null: [], Zeiger] - (BlockStmt - (ReturnStmt - (CastExpr[Zeiger] - (IntLit(0)) - ) - ) - ) - ) - - (FuncDecl[C_Memcpy: [{{ein Name dest 0 Range{Start: Pos{L: 15 C: 54} End: Pos{L: 15 C: 58}} } Zeiger Range{Start: Pos{L: 15 C: 74} End: Pos{L: 15 C: 84}} } {{ein Name src 0 Range{Start: Pos{L: 15 C: 60} End: Pos{L: 15 C: 63}} } Zeiger Range{Start: Pos{L: 15 C: 86} End: Pos{L: 15 C: 92}} } {{ein Name n 0 Range{Start: Pos{L: 15 C: 68} End: Pos{L: 15 C: 69}} } Zahl Range{Start: Pos{L: 15 C: 97} End: Pos{L: 15 C: 101}} }], nichts] [Extern] [ -Kopiert n Bytes vom Buffer src nach dest (entspricht memcpy() aus der C-stdlib) -]) - - (TypeDefDecl[CString: Public(true)] = Zeiger) - - (FuncDecl[Text_Zu_CString: [{{ein Name t 0 Range{Start: Pos{L: 25 C: 60} End: Pos{L: 25 C: 61}} } Text Referenz Range{Start: Pos{L: 25 C: 66} End: Pos{L: 25 C: 83}} }], CString] [Extern] [ -Gibt den unterliegenden CString von t zurück. Der CString ist nur valide solange t auch valide ist. -]) - - (FuncDecl[Text_Zu_Zeiger: [{{ein Name t 0 Range{Start: Pos{L: 29 C: 59} End: Pos{L: 29 C: 60}} } Text Referenz Range{Start: Pos{L: 29 C: 65} End: Pos{L: 29 C: 82}} }], Zeiger] [Extern]) - - (FuncDecl[Text_Byte_Groesse: [{{ein Name t 0 Range{Start: Pos{L: 34 C: 62} End: Pos{L: 34 C: 63}} } Text Referenz Range{Start: Pos{L: 34 C: 68} End: Pos{L: 34 C: 85}} }], Zahl] [Extern]) - - (FuncDecl[Buchstabe_Byte_Groesse: [{{ein Name b 0 Range{Start: Pos{L: 39 C: 67} End: Pos{L: 39 C: 68}} } Buchstabe Range{Start: Pos{L: 39 C: 73} End: Pos{L: 39 C: 86}} }], Zahl] [Extern]) - - (FuncDecl[Erstelle_Byte_Puffer: [{{ein Name n 0 Range{Start: Pos{L: 45 C: 65} End: Pos{L: 45 C: 66}} } Zahl Range{Start: Pos{L: 45 C: 71} End: Pos{L: 45 C: 79}} }], Text] [Extern] [ -Gibt einen null-terminierten Byte Puffer zurück. -]) -) -(ImportStmt - (FuncDecl[Programm_Beenden: [{{ein Name Code 0 Range{Start: Pos{L: 4 C: 61} End: Pos{L: 4 C: 65}} } Zahl Range{Start: Pos{L: 4 C: 70} End: Pos{L: 4 C: 78}} }], nichts] [Extern] [ - Beendet das Programm mit dem gegebenen Code. -]) - - (FuncDecl[Programm_Beenden_Standard: [], nichts] [ - Beendet das Programm mit Code 0. -] - (BlockStmt - (ExprStmt - (FuncCall[Programm_Beenden] - (IntLit(0)) - ) - ) - ) - ) - - (FuncDecl[Laufzeitfehler: [{{ein Name Nachricht 0 Range{Start: Pos{L: 22 C: 60} End: Pos{L: 22 C: 69}} } Text Range{Start: Pos{L: 22 C: 83} End: Pos{L: 22 C: 91}} } {{ein Name Code 0 Range{Start: Pos{L: 22 C: 74} End: Pos{L: 22 C: 78}} } Zahl Range{Start: Pos{L: 22 C: 96} End: Pos{L: 22 C: 100}} }], nichts] [Extern] [ - Wirft einen Laufzeitfehler mit einer Nachricht und einem Code. -]) - - (FuncDecl[Befehlszeilenargumente: [], Text Liste] [Extern] [ - Gibt eine Text Liste zurück die alle übergebenen Befehlszeilenargumente enthält. - Index 1 enthält immer den Programmpfad. -]) - - (FuncDecl[Betriebssystem: [], Text] [Extern] [ - Gibt je nach Betriebssystem entweder "Windows" oder "Linux" zurück. -]) - - (FuncDecl[Ist_Befehlszeile: [], Wahrheitswert] [Extern] [ - Entspricht C's `isatty` funktion. -]) - - (FuncDecl[Macht_Nichts: [], nichts] [ - Leere Funktion, die nichts macht und nichts zurückgibt. - Nützlich in einigen wenigen Fällen. -] - (BlockStmt) - ) - - (FuncDecl[Arbeitsverzeichnis: [], Text] [Extern] [ - Gibt den aktuellen Arbeitsverzeichnis zurück. -]) -) -(DeclStmt - (StructDecl[TextBauer: Public(true)] - (VarDecl[puffer: Text] - (FuncCall[Erstelle_Byte_Puffer] - (IntLit(128)) - ) - ) - - (VarDecl[länge: Zahl] - (IntLit(0)) - ) - ) -) -(DeclStmt - (FuncDecl[Erhoehe_Kapazitaet: [{{ein Name bauer 0 Range{Start: Pos{L: 11 C: 52} End: Pos{L: 11 C: 57}} } TextBauer Referenz Range{Start: Pos{L: 11 C: 76} End: Pos{L: 11 C: 98}} } {{ein Name neue_kapa 0 Range{Start: Pos{L: 11 C: 62} End: Pos{L: 11 C: 71}} } Zahl Range{Start: Pos{L: 11 C: 103} End: Pos{L: 11 C: 107}} }], nichts] [Extern]) -) -(DeclStmt - (FuncDecl[TextBauer_Buchstabe_Anfuegen_C: [{{ein Name bauer 0 Range{Start: Pos{L: 16 C: 64} End: Pos{L: 16 C: 69}} } TextBauer Referenz Range{Start: Pos{L: 16 C: 80} End: Pos{L: 16 C: 102}} } {{ein Name b 0 Range{Start: Pos{L: 16 C: 74} End: Pos{L: 16 C: 75}} } Buchstabe Range{Start: Pos{L: 16 C: 107} End: Pos{L: 16 C: 116}} }], nichts] [Extern]) -) -(DeclStmt - (FuncDecl[Kapazität_Berechnen: [{{ein Name bauer 0 Range{Start: Pos{L: 21 C: 53} End: Pos{L: 21 C: 58}} } TextBauer Referenz Range{Start: Pos{L: 21 C: 69} End: Pos{L: 21 C: 91}} } {{ein Name n 0 Range{Start: Pos{L: 21 C: 63} End: Pos{L: 21 C: 64}} } Zahl Range{Start: Pos{L: 21 C: 96} End: Pos{L: 21 C: 100}} }], Zahl] - (BlockStmt - (DeclStmt - (VarDecl[kapa: Zahl] - (FuncCall[Text_Byte_Groesse] - (FieldAccess - (Ident[puffer]) - - (Ident[bauer]) - ) - ) - ) - ) - - (IfStmt - (BinaryExpr[kleiner als] - (Ident[n]) - - (BinaryExpr[mal] - (Ident[kapa]) - - (FloatLit(1.750000)) - ) - ) - - (BlockStmt - (ReturnStmt - (CastExpr[Zahl] - (Grouping - (BinaryExpr[mal] - (Ident[kapa]) - - (FloatLit(1.750000)) - ) - ) - ) - ) - ) - ) - - (ReturnStmt - (Ident[n]) - ) - ) - ) -) -(DeclStmt - (FuncDecl[Bauer_Ende_Zeiger: [{{ein Name bauer 0 Range{Start: Pos{L: 29 C: 50} End: Pos{L: 29 C: 55}} } TextBauer Referenz Range{Start: Pos{L: 29 C: 60} End: Pos{L: 29 C: 82}} }], Zeiger] - (BlockStmt - (ReturnStmt - (CastExpr[Zeiger] - (Grouping - (BinaryExpr[plus] - (CastExpr[Zahl] - (CastExpr[Zeiger] - (CastExpr[CString] - (Grouping - (BinaryExpr[von] - (Ident[puffer]) - - (Ident[bauer]) - ) - ) - ) - ) - ) - - (Grouping - (BinaryExpr[von] - (Ident[länge]) - - (Ident[bauer]) - ) - ) - ) - ) - ) - ) - ) - ) -) -(DeclStmt - (FuncDecl[TextBauer_Text_Referenz_Anfügen: [{{ein Name bauer 0 Range{Start: Pos{L: 34 C: 77} End: Pos{L: 34 C: 82}} } TextBauer Referenz Range{Start: Pos{L: 34 C: 96} End: Pos{L: 34 C: 118}} } {{ein Name text 0 Range{Start: Pos{L: 34 C: 87} End: Pos{L: 34 C: 91}} } Text Referenz Range{Start: Pos{L: 34 C: 123} End: Pos{L: 34 C: 136}} }], nichts] - (BlockStmt - (DeclStmt - (VarDecl[kapa_bauer: Zahl] - (FuncCall[Text_Byte_Groesse] - (FieldAccess - (Ident[puffer]) - - (Ident[bauer]) - ) - ) - ) - ) - - (DeclStmt - (VarDecl[kapa_text: Zahl] - (FuncCall[Text_Byte_Groesse] - (Ident[text]) - ) - ) - ) - - (IfStmt - (BinaryExpr[kleiner als] - (BinaryExpr[minus] - (Ident[kapa_bauer]) - - (Grouping - (BinaryExpr[von] - (Ident[länge]) - - (Ident[bauer]) - ) - ) - ) - - (Ident[kapa_text]) - ) - - (BlockStmt - (ExprStmt - (FuncCall[Erhoehe_Kapazitaet] - (Ident[bauer]) - - (Grouping - (FuncCall[Kapazität_Berechnen] - (Grouping - (BinaryExpr[plus] - (Ident[kapa_bauer]) - - (Ident[kapa_text]) - ) - ) - - (Ident[bauer]) - ) - ) - ) - ) - ) - ) - - (ExprStmt - (FuncCall[C_Memcpy] - (Ident[kapa_text]) - - (Grouping - (CastExpr[Zeiger] - (CastExpr[CString] - (Ident[text]) - ) - ) - ) - - (Grouping - (FuncCall[Bauer_Ende_Zeiger] - (Ident[bauer]) - ) - ) - ) - ) - - (AssignStmt - (FieldAccess - (Ident[länge]) - - (Ident[bauer]) - ) - - (BinaryExpr[plus] - (FieldAccess - (Ident[länge]) - - (Ident[bauer]) - ) - - (Ident[kapa_text]) - ) - ) - ) - ) -) -(DeclStmt - (FuncDecl[TextBauer_Buchstabe_Anfügen: [{{ein Name bauer 0 Range{Start: Pos{L: 46 C: 73} End: Pos{L: 46 C: 78}} } TextBauer Referenz Range{Start: Pos{L: 46 C: 89} End: Pos{L: 46 C: 111}} } {{ein Name b 0 Range{Start: Pos{L: 46 C: 83} End: Pos{L: 46 C: 84}} } Buchstabe Range{Start: Pos{L: 46 C: 116} End: Pos{L: 46 C: 125}} }], nichts] - (BlockStmt - (IfStmt - (BinaryExpr[gleich] - (CastExpr[Zahl] - (Ident[b]) - ) - - (IntLit(0)) - ) - - (BlockStmt - (ReturnStmt[void]) - ) - ) - - (DeclStmt - (VarDecl[kapa_bauer: Zahl] - (FuncCall[Text_Byte_Groesse] - (FieldAccess - (Ident[puffer]) - - (Ident[bauer]) - ) - ) - ) - ) - - (DeclStmt - (VarDecl[kapa_text: Zahl] - (FuncCall[Buchstabe_Byte_Groesse] - (Ident[b]) - ) - ) - ) - - (IfStmt - (BinaryExpr[kleiner als] - (BinaryExpr[minus] - (Ident[kapa_bauer]) - - (Grouping - (BinaryExpr[von] - (Ident[länge]) - - (Ident[bauer]) - ) - ) - ) - - (Ident[kapa_text]) - ) - - (BlockStmt - (ExprStmt - (FuncCall[Erhoehe_Kapazitaet] - (Ident[bauer]) - - (Grouping - (FuncCall[Kapazität_Berechnen] - (Grouping - (BinaryExpr[plus] - (Ident[kapa_bauer]) - - (Ident[kapa_text]) - ) - ) - - (Ident[bauer]) - ) - ) - ) - ) - ) - ) - - (ExprStmt - (FuncCall[TextBauer_Buchstabe_Anfuegen_C] - (Ident[b]) - - (Ident[bauer]) - ) - ) - - (AssignStmt - (FieldAccess - (Ident[länge]) - - (Ident[bauer]) - ) - - (BinaryExpr[plus] - (FieldAccess - (Ident[länge]) - - (Ident[bauer]) - ) - - (Ident[kapa_text]) - ) - ) - ) - ) -) -(DeclStmt - (FuncDecl[TextBauer_Text_Anfügen: [{{ein Name bauer 0 Range{Start: Pos{L: 60 C: 68} End: Pos{L: 60 C: 73}} } TextBauer Referenz Range{Start: Pos{L: 60 C: 87} End: Pos{L: 60 C: 109}} } {{ein Name text 0 Range{Start: Pos{L: 60 C: 78} End: Pos{L: 60 C: 82}} } Text Range{Start: Pos{L: 60 C: 114} End: Pos{L: 60 C: 118}} }], nichts] - (BlockStmt - (ExprStmt - (FuncCall[TextBauer_Text_Referenz_Anfügen] - (Ident[text]) - - (Ident[bauer]) - ) - ) - ) - ) -) -(DeclStmt - (FuncDecl[TextBauer_Als_Text: [{{ein Name bauer 0 Range{Start: Pos{L: 66 C: 63} End: Pos{L: 66 C: 68}} } TextBauer Referenz Range{Start: Pos{L: 66 C: 73} End: Pos{L: 66 C: 95}} }], Text] [Extern]) -) - diff --git a/lib/external/Makefile b/lib/external/Makefile index a584715..4e808c5 100644 --- a/lib/external/Makefile +++ b/lib/external/Makefile @@ -1,4 +1,4 @@ -.PHONY: all clean checkout-submodules +.PHONY: all clean checkout-submodules clean-pcre2 clean-libarchive clean-xz cleanlibz clean-bz2 clean-lz4 .DEFAULT_GOAL = all RM = rm -f @@ -6,7 +6,7 @@ MKDIR = mkdir -p CC = gcc -CMAKE_BUILD_TOOL=$(MAKE) +CMAKE=cmake CMAKE_GENERATOR="MinGW Makefiles" CMAKE_OPTIONS=-DCMAKE_BUILD_TYPE=Release -G$(CMAKE_GENERATOR) -DCMAKE_C_COMPILER=$(CC) -DCMAKE_COLOR_MAKEFILE=OFF @@ -46,14 +46,14 @@ checkout-submodules: $(PCRE2_OUT_FILE_NAME): | checkout-submodules @echo "building pcre2" $(MKDIR) $(PCRE2_DIR) - cmake -S./pcre2/ -B$(PCRE2_DIR) $(CMAKE_OPTIONS) - cd $(PCRE2_DIR) && $(CMAKE_BUILD_TOOL) pcre2-8-static + '$(CMAKE)' -S./pcre2/ -B$(PCRE2_DIR) $(CMAKE_OPTIONS) + '$(MAKE)' -C $(PCRE2_DIR) pcre2-8-static cp $(PCRE2_DIR)$(PCRE2_OUT_FILE_NAME) . $(LIBZ_NAME): | checkout-submodules @echo "building zlib" - cmake -S./zlib/ -B$(ZLIB_DIR) $(CMAKE_OPTIONS) - cd $(ZLIB_DIR) ; make zlibstatic + '$(CMAKE)' -S./zlib/ -B$(ZLIB_DIR) $(CMAKE_OPTIONS) + '$(MAKE)' -C $(ZLIB_DIR) zlibstatic mkdir -p $(ZLIB_DIR)include cp ./zlib/*.h $(ZLIB_DIR)include/ cp $(ZLIB_DIR)zconf.h $(ZLIB_DIR)include/ @@ -61,37 +61,42 @@ $(LIBZ_NAME): | checkout-submodules $(XZ_NAME): | checkout-submodules @echo "building lzma" - cmake -S./xz/ -B$(XZ_DIR) $(CMAKE_OPTIONS) -DBUILD_SHARED_LIBS=OFF - cd $(XZ_DIR) ; make liblzma - mkdir -p $(XZ_DIR)include + '$(CMAKE)' -S./xz/ -B$(XZ_DIR) $(CMAKE_OPTIONS) -DBUILD_SHARED_LIBS=OFF + '$(MAKE)' -C $(XZ_DIR) liblzma + mkdir -p $(XZ_DIR)include/ cp -r ./xz/src/liblzma/api/* $(XZ_DIR)include/ cp $(XZ_DIR)$(XZ_NAME) . $(BZ2_NAME): | checkout-submodules @echo "building bzip2" - cd ./bzip2/ ; make bzip2 + '$(MAKE)' -C ./bzip2/ cp ./bzip2/$(BZ2_NAME) . $(LZ4_NAME): | checkout-submodules @echo "building lz4" - cd ./lz4/ ; make CC=$(CC) liblz4.a + '$(MAKE)' -C ./lz4/ 'CC=$(CC)' liblz4.a cp ./lz4/lib/$(LZ4_NAME) . -$(LIBAR_OUT_FILE_NAME): $(LIBZ_NAME) $(XZ_NAME) $(BZ2_NAME) $(LZ4_NAME) +$(LIBAR_OUT_FILE_NAME): $(LIBZ_NAME) $(XZ_NAME) $(BZ2_NAME) $(LZ4_NAME) $(PCRE2_OUT_FILE_NAME) @echo "building libarchive" - cmake -S./libarchive/ -B$(LIBAR_DIR) $(CMAKE_OPTIONS) $(LIBAR_CMAKE_OPTIONS) $(LIBAR_DEP_INCLUDES) - cd $(LIBAR_DIR) ; make archive_static - cp $(LIBAR_DIR)/libarchive/$(LIBAR_OUT_FILE_NAME) . - -all: checkout-submodules $(PCRE2_OUT_FILE_NAME) $(LIBAR_OUT_FILE_NAME) - -clean: -ifeq ($(OS),Windows_NT) - $(RM) $(PCRE2_OUT_FILE_NAME) - cd $(PCRE2_DIR) ; $(CMAKE_BUILD_TOOL) clean -endif - $(RM) $(LIBAR_OUT_FILE_NAME) - $(RM) $(LIBZ_NAME) - $(RM) $(XZ_NAME) - $(RM) $(BZ2_NAME) - $(RM) $(LZ4_NAME) \ No newline at end of file + '$(CMAKE)' -S./libarchive/ -B$(LIBAR_DIR) $(CMAKE_OPTIONS) $(LIBAR_CMAKE_OPTIONS) $(LIBAR_DEP_INCLUDES) + '$(MAKE)' -C $(LIBAR_DIR) archive_static + cp $(LIBAR_DIR)libarchive/$(LIBAR_OUT_FILE_NAME) . + +all: checkout-submodules $(LIBAR_OUT_FILE_NAME) + +clean-pcre2: + '$(MAKE)' -C $(PCRE2_DIR) clean +clean-libarchive: + '$(MAKE)' -C ./libarchive_build/ clean +clean-xz: + '$(MAKE)' -C $(XZ_DIR) clean +clean-libz: + '$(MAKE)' -C $(ZLIB_DIR) clean +clean-bz2: + '$(MAKE)' -C ./bzip2/ clean +clean-lz4: + '$(MAKE)' -C ./lz4/ clean + +clean: clean-pcre2 clean-libarchive clean-xz cleanlibz clean-bz2 clean-lz4 + $(RM) $(PCRE2_OUT_FILE_NAME) $(LIBAR_OUT_FILE_NAME) $(LIBZ_NAME) $(XZ_NAME) $(BZ2_NAME) $(LZ4_NAME) \ No newline at end of file