mongoose/examples/http-server/Makefile

25 lines
897 B
Makefile
Raw Normal View History

2020-12-11 01:39:40 +08:00
PROG ?= example
ROOT ?= $(realpath $(CURDIR)/../..)
2021-07-29 21:21:20 +08:00
DEFS ?= -DMG_ENABLE_LINES=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 -it --rm -e Tmp=. -v $(ROOT):$(ROOT) -w $(CURDIR) mdashnet/vc98
LIN = docker run -it --rm -v $(ROOT):$(ROOT) -w $(CURDIR) mdashnet/cc2
2020-12-11 01:39:40 +08:00
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
2021-01-19 22:21:50 +08:00
$(CC) ../../mongoose.c main.c -I../.. $(CFLAGS) -o $@
2020-12-11 01:39:40 +08:00
mongoose.exe: main.c
2021-01-19 22:21:50 +08:00
$(VC98) wine cl ../../mongoose.c main.c $(VCFLAGS) ws2_32.lib /out:$@
2020-12-11 01:39:40 +08:00
linux: all
linux: CFLAGS += -O2 -fsanitize=address,undefined,shift,null,return,bounds,alignment,object-size,bool,enum -static-libasan
#linux: CC = $(LIN) cc
#linux: DEBUGGER = $(LIN)
2020-12-11 01:39:40 +08:00
clean:
rm -rf $(PROG) *.o *.dSYM *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb mongoose mongoose_* mongoose.*