2020-12-10 17:39:40 +00:00
|
|
|
PROG ?= example
|
|
|
|
ROOT ?= $(realpath $(CURDIR)/../..)
|
2022-09-08 11:02:32 +01:00
|
|
|
DEFS ?= -DMG_ENABLE_LINES=1 -DMG_ENABLE_IPV6=1 -DMG_ENABLE_SSI=1 -DMG_HTTP_DIRLIST_TIME=1
|
2022-05-08 21:54:15 +01:00
|
|
|
CFLAGS ?= -I../.. -W -Wall $(DEFS) $(EXTRA)
|
2021-01-13 03:07:51 +00:00
|
|
|
VCFLAGS = /nologo /W3 /O2 /I../.. $(DEFS) $(EXTRA) /link /incremental:no /machine:IX86
|
2021-03-22 11:30:48 +00:00
|
|
|
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-10 17:39:40 +00:00
|
|
|
|
|
|
|
all: $(PROG)
|
2022-06-01 16:25:04 +01:00
|
|
|
$(RUN) ./$(PROG) $(ARGS)
|
2020-12-10 17:39:40 +00:00
|
|
|
|
2021-01-12 15:18:19 +00:00
|
|
|
$(PROG): main.c Makefile
|
2021-01-19 14:21:50 +00:00
|
|
|
$(CC) ../../mongoose.c main.c -I../.. $(CFLAGS) -o $@
|
2020-12-10 17:39:40 +00:00
|
|
|
|
|
|
|
mongoose.exe: main.c
|
2021-01-19 14:21:50 +00:00
|
|
|
$(VC98) wine cl ../../mongoose.c main.c $(VCFLAGS) ws2_32.lib /out:$@
|
2020-12-10 17:39:40 +00:00
|
|
|
|
2021-12-16 09:22:28 +00:00
|
|
|
mingw:
|
|
|
|
gcc ../../mongoose.c main.c -I../.. -W -Wall -DMG_ENABLE_IPV6=1 -DMG_ENABLE_LINES=1 -D_POSIX_C_SOURCE=200000L -lws2_32 -o mongoose.exe
|
|
|
|
|
2022-06-01 16:25:04 +01:00
|
|
|
linux: example
|
2022-06-01 17:09:15 +01:00
|
|
|
#linux: CFLAGS += -O2 -fsanitize=address,undefined,shift,null,return,bounds,alignment,object-size,bool,enum -static-libasan
|
2022-06-01 16:25:04 +01:00
|
|
|
linux: CC = $(LIN) cc
|
2021-03-22 11:30:48 +00:00
|
|
|
|
2020-12-10 17:39:40 +00:00
|
|
|
clean:
|
|
|
|
rm -rf $(PROG) *.o *.dSYM *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb mongoose mongoose_* mongoose.*
|