From ca256b9949ea251a57c2f4d3499590a831e90ebd Mon Sep 17 00:00:00 2001 From: "Sergio R. Caprile" Date: Wed, 15 Feb 2023 18:23:52 -0300 Subject: [PATCH] Win friendly #2047 --- examples/device-dashboard/Makefile | 2 ++ examples/embedded-filesystem/Makefile | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/examples/device-dashboard/Makefile b/examples/device-dashboard/Makefile index d59281d3..0ae50778 100644 --- a/examples/device-dashboard/Makefile +++ b/examples/device-dashboard/Makefile @@ -21,12 +21,14 @@ endif all: $(PROG) $(RUN) ./$(PROG) $(ARGS) +ifneq ($(OS),Windows_NT) # Before embedding files, gzip them to save space packed_fs.c: $(shell find web_root -type f) Makefile rm -rf tmp/web_root && mkdir tmp && cp -r web_root tmp/ find tmp -type f | xargs -n1 gzip $(CC) ../../test/pack.c -o pack cd tmp && ../pack `find web_root -type f` > ../$@ +endif $(PROG): $(SOURCES) $(CC) $(SOURCES) $(CFLAGS) $(CFLAGS_MONGOOSE) $(CFLAGS_EXTRA) $(OUT) diff --git a/examples/embedded-filesystem/Makefile b/examples/embedded-filesystem/Makefile index 9f42f0c6..cce143ec 100644 --- a/examples/embedded-filesystem/Makefile +++ b/examples/embedded-filesystem/Makefile @@ -13,23 +13,25 @@ ifeq ($(OS),Windows_NT) CFLAGS += -lws2_32 # Link against Winsock library DELETE = cmd /C del /Q /F /S # Command prompt command to delete files OUT ?= -o $(PROG) # Build output + PACK = pack.exe else # Mac, Linux PROG ?= example DELETE = rm -rf OUT ?= -o $(PROG) + PACK = ./pack endif all: $(PROG) $(RUN) ./$(PROG) $(ARGS) $(PROG): $(SOURCES) $(FILES_TO_EMBED) - $(CC) ../../test/pack.c -o pack - ./pack $(FILES_TO_EMBED) > packed_fs.c + $(CC) ../../test/pack.c -o $(PACK) + $(PACK) $(FILES_TO_EMBED) > packed_fs.c $(CC) $(SOURCES) $(CFLAGS) $(CFLAGS_MONGOOSE) $(CFLAGS_EXTRA) $(OUT) clean: - $(DELETE) $(PROG) *.dSYM pack + $(DELETE) $(PROG) *.dSYM $(PACK) .PHONY: compress expand gzipped plain all