From a118862d8fee5ee27ef8ed4e8c438963ecfef9f2 Mon Sep 17 00:00:00 2001 From: Lukas Fittl Date: Sun, 31 Dec 2023 23:03:43 -0800 Subject: [PATCH] WIP --- .github/workflows/ci.yml | 2 +- Makefile.windows => Makefile.msvc | 40 ++++++++++++++++--------------- 2 files changed, 22 insertions(+), 20 deletions(-) rename Makefile.windows => Makefile.msvc (71%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c9d18624..298af5ec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,7 +85,7 @@ jobs: - name: Check out code uses: actions/checkout@v4 - name: Build and run tests - run: nmake /F Makefile.windows + run: nmake /F Makefile.msvc build_windows_msys2: runs-on: windows-latest strategy: diff --git a/Makefile.windows b/Makefile.msvc similarity index 71% rename from Makefile.windows rename to Makefile.msvc index 7249005c..7040a8e1 100644 --- a/Makefile.windows +++ b/Makefile.msvc @@ -1,3 +1,5 @@ +# Makefile for "nmake", part of Microsoft Visual Studio Compiler (MSVC) on Windows + TARGET = pg_query ARLIB = $(TARGET).lib @@ -31,22 +33,22 @@ examples: $(EXAMPLES) .\examples\simple_plpgsql examples/simple: examples/simple.c $(ARLIB) - $(CC) $(CFLAGS) -o $@ -g examples/simple.c $(ARLIB) + $(CC) $(CFLAGS) /OUT:$@ examples/simple.c $(ARLIB) examples/scan: examples/scan.c $(ARLIB) - $(CC) $(CFLAGS) -o $@ -g examples/scan.c $(ARLIB) + $(CC) $(CFLAGS) /OUT:$@ examples/scan.c $(ARLIB) examples/normalize: examples/normalize.c $(ARLIB) - $(CC) $(CFLAGS) -o $@ -g examples/normalize.c $(ARLIB) + $(CC) $(CFLAGS) /OUT:$@ examples/normalize.c $(ARLIB) examples/simple_error: examples/simple_error.c $(ARLIB) - $(CC) $(CFLAGS) -o $@ -g examples/simple_error.c $(ARLIB) + $(CC) $(CFLAGS) /OUT:$@ examples/simple_error.c $(ARLIB) examples/normalize_error: examples/normalize_error.c $(ARLIB) - $(CC) $(CFLAGS) -o $@ -g examples/normalize_error.c $(ARLIB) + $(CC) $(CFLAGS) /OUT:$@ examples/normalize_error.c $(ARLIB) examples/simple_plpgsql: examples/simple_plpgsql.c $(ARLIB) - $(CC) $(CFLAGS) -o $@ -g examples/simple_plpgsql.c $(ARLIB) + $(CC) $(CFLAGS) /OUT:$@ examples/simple_plpgsql.c $(ARLIB) TESTS = test/deparse test/fingerprint test/fingerprint_opts test/normalize test/parse test/parse_opts test/parse_protobuf test/parse_protobuf_opts test/parse_plpgsql test/scan test/split test: $(TESTS) @@ -64,43 +66,43 @@ test: $(TESTS) # Doesn't work because of C2026: string too big, trailing characters truncated #test/complex: test/complex.c $(ARLIB) # We have "-Isrc/" because this test uses pg_query_fingerprint_with_opts -# $(CC) $(CFLAGS) -o $@ -Isrc/ test/complex.c $(ARLIB) +# $(CC) $(CFLAGS) /OUT:$@ -Isrc/ test/complex.c $(ARLIB) # Doesn't work since this requires pthreads #test/concurrency: test/concurrency.c test/parse_tests.c $(ARLIB) -# $(CC) $(CFLAGS) -o $@ test/concurrency.c $(ARLIB) +# $(CC) $(CFLAGS) /OUT:$@ test/concurrency.c $(ARLIB) test/deparse: test/deparse.c test/deparse_tests.c $(ARLIB) - $(CC) $(CFLAGS) -o $@ test/deparse.c $(ARLIB) + $(CC) $(CFLAGS) /OUT:$@ test/deparse.c $(ARLIB) test/fingerprint: test/fingerprint.c test/fingerprint_tests.c $(ARLIB) # We have "-Isrc/" because this test uses pg_query_fingerprint_with_opts - $(CC) $(CFLAGS) -o $@ -Isrc/ test/fingerprint.c $(ARLIB) + $(CC) $(CFLAGS) /OUT:$@ -Isrc/ test/fingerprint.c $(ARLIB) test/fingerprint_opts: test/fingerprint_opts.c test/fingerprint_opts_tests.c $(ARLIB) # We have "-Isrc/" because this test uses pg_query_fingerprint_with_opts - $(CC) $(CFLAGS) -o $@ -Isrc/ test/fingerprint_opts.c $(ARLIB) + $(CC) $(CFLAGS) /OUT:$@ -Isrc/ test/fingerprint_opts.c $(ARLIB) test/normalize: test/normalize.c test/normalize_tests.c $(ARLIB) - $(CC) $(CFLAGS) -o $@ test/normalize.c $(ARLIB) + $(CC) $(CFLAGS) /OUT:$@ test/normalize.c $(ARLIB) test/parse: test/parse.c test/parse_tests.c $(ARLIB) - $(CC) $(CFLAGS) -o $@ test/parse.c $(ARLIB) + $(CC) $(CFLAGS) /OUT:$@ test/parse.c $(ARLIB) test/parse_opts: test/parse_opts.c test/parse_opts_tests.c $(ARLIB) - $(CC) $(CFLAGS) -o $@ test/parse_opts.c $(ARLIB) + $(CC) $(CFLAGS) /OUT:$@ test/parse_opts.c $(ARLIB) test/parse_plpgsql: test/parse_plpgsql.c test/parse_tests.c $(ARLIB) - $(CC) $(CFLAGS) -o $@ test/parse_plpgsql.c $(ARLIB) + $(CC) $(CFLAGS) /OUT:$@ test/parse_plpgsql.c $(ARLIB) test/parse_protobuf: test/parse_protobuf.c test/parse_tests.c $(ARLIB) - $(CC) $(CFLAGS) -o $@ test/parse_protobuf.c $(ARLIB) + $(CC) $(CFLAGS) /OUT:$@ test/parse_protobuf.c $(ARLIB) test/parse_protobuf_opts: test/parse_protobuf_opts.c test/parse_opts_tests.c $(ARLIB) - $(CC) $(CFLAGS) -o $@ test/parse_protobuf_opts.c $(ARLIB) + $(CC) $(CFLAGS) /OUT:$@ test/parse_protobuf_opts.c $(ARLIB) test/scan: test/scan.c test/scan_tests.c $(ARLIB) - $(CC) $(CFLAGS) -o $@ test/scan.c $(ARLIB) + $(CC) $(CFLAGS) /OUT:$@ test/scan.c $(ARLIB) test/split: test/split.c test/split_tests.c $(ARLIB) - $(CC) $(CFLAGS) -o $@ test/split.c $(ARLIB) + $(CC) $(CFLAGS) /OUT:$@ test/split.c $(ARLIB)