Win friendly #2047

This commit is contained in:
Sergio R. Caprile committed 2023-02-17 10:40:53 -03:00
1 parent 68750f3455
commit ca256b9949
2 files changed
+7 -3

No files matched your search

+2
View File
@@ -21,12 +21,14 @@ endif
all: $(PROG) all: $(PROG)
$(RUN) ./$(PROG) $(ARGS) $(RUN) ./$(PROG) $(ARGS)
ifneq ($(OS),Windows_NT)
# Before embedding files, gzip them to save space # Before embedding files, gzip them to save space
packed_fs.c: $(shell find web_root -type f) Makefile packed_fs.c: $(shell find web_root -type f) Makefile
rm -rf tmp/web_root && mkdir tmp && cp -r web_root tmp/ rm -rf tmp/web_root && mkdir tmp && cp -r web_root tmp/
find tmp -type f | xargs -n1 gzip find tmp -type f | xargs -n1 gzip
$(CC) ../../test/pack.c -o pack $(CC) ../../test/pack.c -o pack
cd tmp && ../pack `find web_root -type f` > ../$@ cd tmp && ../pack `find web_root -type f` > ../$@
endif
$(PROG): $(SOURCES) $(PROG): $(SOURCES)
$(CC) $(SOURCES) $(CFLAGS) $(CFLAGS_MONGOOSE) $(CFLAGS_EXTRA) $(OUT) $(CC) $(SOURCES) $(CFLAGS) $(CFLAGS_MONGOOSE) $(CFLAGS_EXTRA) $(OUT)
+5 -3
View File
@@ -13,23 +13,25 @@ ifeq ($(OS),Windows_NT)
CFLAGS += -lws2_32 # Link against Winsock library CFLAGS += -lws2_32 # Link against Winsock library
DELETE = cmd /C del /Q /F /S # Command prompt command to delete files DELETE = cmd /C del /Q /F /S # Command prompt command to delete files
OUT ?= -o $(PROG) # Build output OUT ?= -o $(PROG) # Build output
PACK = pack.exe
else else
# Mac, Linux # Mac, Linux
PROG ?= example PROG ?= example
DELETE = rm -rf DELETE = rm -rf
OUT ?= -o $(PROG) OUT ?= -o $(PROG)
PACK = ./pack
endif endif
all: $(PROG) all: $(PROG)
$(RUN) ./$(PROG) $(ARGS) $(RUN) ./$(PROG) $(ARGS)
$(PROG): $(SOURCES) $(FILES_TO_EMBED) $(PROG): $(SOURCES) $(FILES_TO_EMBED)
$(CC) ../../test/pack.c -o pack $(CC) ../../test/pack.c -o $(PACK)
./pack $(FILES_TO_EMBED) > packed_fs.c $(PACK) $(FILES_TO_EMBED) > packed_fs.c
$(CC) $(SOURCES) $(CFLAGS) $(CFLAGS_MONGOOSE) $(CFLAGS_EXTRA) $(OUT) $(CC) $(SOURCES) $(CFLAGS) $(CFLAGS_MONGOOSE) $(CFLAGS_EXTRA) $(OUT)
clean: clean:
$(DELETE) $(PROG) *.dSYM pack $(DELETE) $(PROG) *.dSYM $(PACK)
.PHONY: compress expand gzipped plain all .PHONY: compress expand gzipped plain all