33 lines
1.2 KiB
Makefile
Raw Normal View History

2020-12-05 11:26:32 +00:00
PROG ?= example
2021-07-26 09:05:34 +01:00
SOURCES ?= ../../mongoose.c main.c mjson.c packed_fs.c
2021-07-30 13:19:20 +01:00
CFLAGS ?= -I../.. -DMG_ENABLE_PACKED_FS=1 $(EXTRA)
2021-07-25 10:22:56 +01:00
FILES_TO_EMBED ?= $(wildcard web_root/*.js) $(wildcard web_root/*.css) $(wildcard web_root/*.html) $(wildcard web_root/images/*.png) $(wildcard images/*.jpg)
2022-04-19 18:46:14 +01:00
ROOT ?= $(realpath $(CURDIR)/../../..)
DOCKER ?= docker run --rm -e Tmp=. -e WINEDEBUG=-all -v $(ROOT):$(ROOT) -w $(CURDIR)
VC98 ?= $(DOCKER) mdashnet/vc98 wine
MINGW ?= $(DOCKER) mdashnet/mingw
2020-12-05 11:26:32 +00:00
all: $(PROG)
2021-07-25 10:22:56 +01:00
$(RUN) ./$(PROG)
2020-12-05 11:26:32 +00:00
$(PROG):
2021-07-30 13:19:20 +01:00
$(CC) ../../test/pack.c -o pack
2021-07-26 09:05:34 +01:00
./pack $(FILES_TO_EMBED) > packed_fs.c
2021-07-25 21:08:02 +01:00
$(CC) -W -Wall -Wextra -Os -g3 $(CFLAGS) -o $(PROG) $(SOURCES)
2021-07-25 10:22:56 +01:00
2022-04-19 18:46:14 +01:00
mingw:
$(MINGW) i686-w64-mingw32-gcc $(CFLAGS) ../../test/pack.c -o pack.exe
$(MINGW) wine cmd /c 'pack.exe $(FILES_TO_EMBED) > packed_fs.c'
$(MINGW) i686-w64-mingw32-gcc $(CFLAGS) $(SOURCES) -lws2_32 -o $(PROG).exe
$(MINGW) wine $(PROG).exe
vc98:
$(VC98) cl.exe /nologo $(CFLAGS) ../../test/pack.c /Fepack.exe
$(VC98) cmd /c 'pack.exe $(FILES_TO_EMBED) > packed_fs.c'
$(VC98) cl.exe /nologo /O2 $(CFLAGS) $(SOURCES) ws2_32.lib -o $(PROG).exe
$(VC98) $(PROG).exe
2020-12-05 11:26:32 +00:00
clean:
2021-07-29 14:21:20 +01:00
rm -rf $(PROG) *.o *.dSYM *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb log.txt packed_fs.c pack