mongoose/examples/complete/Makefile

24 lines
871 B
Makefile
Raw Normal View History

2020-12-05 19:26:32 +08:00
PROG ?= example
2021-07-25 17:22:56 +08:00
SOURCES ?= ../../mongoose.c main.c mjson.c fs.c
CFLAGS ?= -I../.. $(EXTRA)
FILES_TO_EMBED ?= $(wildcard web_root/*.js) $(wildcard web_root/*.css) $(wildcard web_root/*.html) $(wildcard web_root/images/*.png) $(wildcard images/*.jpg)
2020-12-05 19:26:32 +08:00
all: $(PROG)
2021-07-25 17:22:56 +08:00
$(RUN) ./$(PROG)
2020-12-05 19:26:32 +08:00
$(PROG):
2021-07-25 17:22:56 +08:00
$(CC) pack.c -o pack
./pack $(FILES_TO_EMBED) > fs.c
$(CC) -W -Wall -Wextra -O3 -g3 $(CFLAGS) -o $(PROG) $(SOURCES)
ROOT ?= $(realpath $(CURDIR)/../..)
DOCKER ?= docker run -it --rm -e Tmp=. -e WINEDEBUG=-all -v $(ROOT):$(ROOT) -w $(CURDIR) mdashnet/vc98 wine
windows:
$(DOCKER) cl.exe /nologo $(CFLAGS) pack.c /Fepack.exe
$(DOCKER) cmd /c 'pack.exe $(FILES_TO_EMBED) > fs.c'
$(DOCKER) cl.exe /nologo /O2 $(CFLAGS) $(SOURCES) ws2_32.lib /Fe$(PROG).exe
$(DOCKER) $(PROG).exe
2020-12-05 19:26:32 +08:00
clean:
2021-07-25 17:22:56 +08:00
rm -rf $(PROG) *.o *.dSYM *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb log.txt fs.c pack