mirror of
https://github.com/cesanta/mongoose.git
synced 2024-11-28 05:39:00 +08:00
Win friendly #2047
This commit is contained in:
parent
68750f3455
commit
ca256b9949
@ -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)
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user