diff --git a/Makefile b/Makefile index 08108bd1..10a5eb78 100644 --- a/Makefile +++ b/Makefile @@ -213,12 +213,16 @@ build/boot.gen.c: src/boot/boot.janet build/xxd ##### Amalgamation ##### ######################## -amalg: build/janet.c build/janet.h build/core_image.c +amalg: build/shell.c build/janet.c build/janet.h build/core_image.c AMALG_SOURCE=$(JANET_LOCAL_HEADERS) $(JANET_CORE_SOURCES) build/core_image.c build/janet.c: $(AMALG_SOURCE) tools/amalg.janet $(JANET_TARGET) $(JANET_TARGET) tools/amalg.janet $(AMALG_SOURCE) > $@ +AMALG_SHELL_SOURCE=src/mainclient/line.h src/mainclient/line.c src/mainclient/main.c +build/shell.c: $(JANET_TARGET) tools/amalg.janet $(AMALG_SHELL_SOURCE) + $(JANET_TARGET) tools/amalg.janet $(AMALG_SHELL_SOURCE) > $@ + build/janet.h: src/include/janet.h cp $< $@ @@ -257,7 +261,7 @@ dist: build/janet-dist.tar.gz build/janet-%.tar.gz: $(JANET_TARGET) \ src/include/janet.h src/conf/janetconf.h \ jpm.1 janet.1 LICENSE CONTRIBUTING.md $(JANET_LIBRARY) $(JANET_STATIC_LIBRARY) \ - build/doc.html README.md build/janet.c + build/doc.html README.md build/janet.c build/shell.c $(eval JANET_DIST_DIR = "janet-$(shell basename $*)") mkdir -p build/$(JANET_DIST_DIR) cp -r $^ build/$(JANET_DIST_DIR)/ diff --git a/appveyor.yml b/appveyor.yml index 38e5a2c8..927684f9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -42,6 +42,9 @@ artifacts: - name: janetconf.h path: dist\janetconf.h type: File + - name: shell.c + path: dist\shell.c + type: File - name: "janet-$(janet_outname)-windows" path: dist type: Zip diff --git a/build_win.bat b/build_win.bat index f339a7b9..d4164702 100644 --- a/build_win.bat +++ b/build_win.bat @@ -96,6 +96,10 @@ for %%f in (src\core\*.c) do ( janet.exe tools\amalg.janet src\core\util.h src\core\state.h src\core\gc.h src\core\vector.h src\core\fiber.h src\core\regalloc.h src\core\compile.h src\core\emit.h src\core\symcache.h %amalg_files% build\core_image.c > build\janet.c janet.exe tools\removecr.janet build\janet.c +@rem Gen shell.c +janet.exe tools\amalg.janet src\mainclient\line.h src\mainclient\line.c src\mainclient\main.c > build\shell.c +janet.exe tools\removecr.janet build\shell.c + echo === Successfully built janet.exe for Windows === echo === Run 'build_win test' to run tests. == echo === Run 'build_win clean' to delete build artifacts. === @@ -137,6 +141,7 @@ janet.exe tools\gendoc.janet > dist\doc.html janet.exe tools\removecr.janet dist\doc.html copy build\janet.c dist\janet.c +copy build\shell.c dist\shell.c copy janet.exe dist\janet.exe copy LICENSE dist\LICENSE copy README.md dist\README.md diff --git a/meson.build b/meson.build index f4984c9d..6ef4598f 100644 --- a/meson.build +++ b/meson.build @@ -213,6 +213,12 @@ amalg = custom_target('amalg', output : ['janet.c'], capture : true, command : [janet_nativeclient, '@INPUT@']) +amalg_shell = custom_target('amalg-shell', + input : ['tools/amalg.janet', 'src/mainclient/line.h', + 'src/mainclient/line.c', 'src/mainlcient/main.c'], + output : ['shell.c'], + capture : true, + command : [janet_nativeclient, '@INPUT@']) # Amalgamated client janet_amalgclient = executable('janet-amalg', amalg, mainclient_src, diff --git a/src/mainclient/line.c b/src/mainclient/line.c index 600a53dc..4b29d064 100644 --- a/src/mainclient/line.c +++ b/src/mainclient/line.c @@ -20,7 +20,9 @@ * IN THE SOFTWARE. */ +#ifndef JANET_AMALG #include "line.h" +#endif /* Common */ Janet janet_line_getter(int32_t argc, Janet *argv) { diff --git a/src/mainclient/line.h b/src/mainclient/line.h index 03699a90..8b312f10 100644 --- a/src/mainclient/line.h +++ b/src/mainclient/line.h @@ -23,7 +23,9 @@ #ifndef JANET_LINE_H_defined #define JANET_LINE_H_defined +#ifndef JANET_AMALG #include +#endif void janet_line_init(); void janet_line_deinit(); diff --git a/src/mainclient/main.c b/src/mainclient/main.c index d665efc9..f7d75d7a 100644 --- a/src/mainclient/main.c +++ b/src/mainclient/main.c @@ -20,8 +20,10 @@ * IN THE SOFTWARE. */ +#ifndef JANET_AMALG #include #include "line.h" +#endif #ifdef _WIN32 #include