mongoose/examples/desktop-server/Makefile

32 lines
1.1 KiB
Makefile
Raw Normal View History

2020-12-11 01:39:40 +08:00
PROG ?= example
ROOT ?= $(realpath $(CURDIR)/../..)
DEFS ?= -DMG_ENABLE_LINES=1 -DMG_ENABLE_DIRECTORY_LISTING=1 -DMG_ENABLE_SSI=1
2020-12-11 01:39:40 +08:00
CFLAGS ?= -I../.. -W -Wall -DMG_ENABLE_IPV6=1 $(DEFS) $(EXTRA)
2021-01-13 11:07:51 +08:00
VCFLAGS = /nologo /W3 /O2 /I../.. $(DEFS) $(EXTRA) /link /incremental:no /machine:IX86
VC98 = docker run --rm -e Tmp=. -v $(ROOT):$(ROOT) -w $(CURDIR) docker.io/mdashnet/vc98
2020-12-11 01:39:40 +08:00
GCC = docker run --rm -v $(ROOT):$(ROOT) -w $(CURDIR) mdashnet/cc2
all: $(PROG)
2021-01-12 23:18:19 +08:00
$(DEBUGGER) ./$(PROG) $(ARGS)
2020-12-11 01:39:40 +08:00
2021-01-12 23:18:19 +08:00
$(PROG): main.c Makefile
2020-12-11 01:39:40 +08:00
$(CC) ../../mongoose.c main.c -I../.. $(CFLAGS) $(EXTRA) -o $@
mongoose_mac: $(PROG)
cp $(PROG) $@
mongoose_linux: main.c
2021-01-13 11:10:42 +08:00
$(GCC) $(CC) ../../mongoose.c main.c $(CFLAGS) -s -o $@
2020-12-11 01:39:40 +08:00
mongoose.exe: main.c
2021-01-13 11:07:51 +08:00
$(VC98) wine rc /fomongoose.res win32/res.rc
$(VC98) wine cl ../../mongoose.c main.c $(VCFLAGS) mongoose.res shell32.lib ws2_32.lib user32.lib /out:$@
2020-12-11 01:39:40 +08:00
zip: mongoose.exe mongoose_linux mongoose_mac
rm -rf mongoose; mkdir mongoose
cp mongoose.exe mongoose_mac mongoose_linux mongoose
zip -r mongoose.zip mongoose
clean:
rm -rf $(PROG) *.o *.dSYM *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb mongoose mongoose_* mongoose.*