From df848973dcb2ea6b746905302a9c64c22d069945 Mon Sep 17 00:00:00 2001 From: Sergey Lyubka <valenok@gmail.com> Date: Tue, 14 Sep 2021 12:27:02 +0100 Subject: [PATCH] Fix unamalgamated target --- .github/workflows/test.yml | 2 ++ Makefile | 6 +++--- src/version.h | 8 -------- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6e3d0a756..3e41aa0fb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,6 +11,8 @@ jobs: run: make test test++ IPV6=0 - name: openssl run: make test SSL=OPENSSL IPV6=0 + - name: unamalgamated + run: make unamalgamated examples: runs-on: ubuntu-latest steps: diff --git a/Makefile b/Makefile index d4802fa0d..c6f56ac62 100644 --- a/Makefile +++ b/Makefile @@ -46,8 +46,8 @@ test++: WARN += -Wno-shadow -Wno-missing-field-initializers -Wno-deprecated test++: test # Make sure we can build from an unamalgamated sources -unamalgamated: $(HDRS) Makefile - $(CC) src/*.c test/unit_test.c $(CFLAGS) $(LDFLAGS) -g -o unit_test +unamalgamated: $(HDRS) Makefile test/packed_fs.c + $(CC) src/*.c test/packed_fs.c test/unit_test.c $(CFLAGS) $(LDFLAGS) -g -o unit_test unpacked: $(CC) -I. mongoose.c test/unit_test.c -o unit_test @@ -125,7 +125,7 @@ mongoose.c: Makefile $(wildcard src/*) (cat src/license.h; echo; echo '#include "mongoose.h"' ; (for F in src/private.h src/*.c ; do echo; echo '#ifdef MG_ENABLE_LINES'; echo "#line 1 \"$$F\""; echo '#endif'; cat $$F | sed -e 's,#include ".*,,'; done))> $@ mongoose.h: $(HDRS) Makefile - (cat src/license.h src/version.h ; cat src/config.h src/arch.h src/arch_*.h src/str.h src/log.h src/timer.h src/util.h src/fs.h src/url.h src/iobuf.h src/base64.h src/md5.h src/sha1.h src/event.h src/net.h src/http.h src/ssi.h src/tls.h src/ws.h src/sntp.h src/mqtt.h src/dns.h | sed -e 's,#include ".*,,' -e 's,^#pragma once,,'; echo; echo '#ifdef __cplusplus'; echo '}'; echo '#endif'; echo '#endif // MONGOOSE_H')> $@ + (cat src/license.h; echo; echo '#ifndef MONGOOSE_H'; echo '#define MONGOOSE_H'; echo; cat src/version.h ; echo; echo '#ifdef __cplusplus'; echo 'extern "C" {'; echo '#endif'; cat src/config.h src/arch.h src/arch_*.h src/str.h src/log.h src/timer.h src/util.h src/fs.h src/url.h src/iobuf.h src/base64.h src/md5.h src/sha1.h src/event.h src/net.h src/http.h src/ssi.h src/tls.h src/ws.h src/sntp.h src/mqtt.h src/dns.h | sed -e 's,#include ".*,,' -e 's,^#pragma once,,'; echo; echo '#ifdef __cplusplus'; echo '}'; echo '#endif'; echo '#endif // MONGOOSE_H')> $@ clean: rm -rf $(PROG) *.o *.dSYM unit_test* ut fuzzer *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb slow-unit* _CL_* infer-out data.txt crash-* test/packed_fs.c pack diff --git a/src/version.h b/src/version.h index cb4837859..cb7ac1a1a 100644 --- a/src/version.h +++ b/src/version.h @@ -1,9 +1 @@ - -#ifndef MONGOOSE_H -#define MONGOOSE_H - #define MG_VERSION "7.4" - -#ifdef __cplusplus -extern "C" { -#endif -- GitLab