mongoose/examples/http-client/Makefile

29 lines
834 B
Makefile
Raw Normal View History

2020-12-10 21:26:05 +08:00
PROG ?= example
2021-01-30 21:03:11 +08:00
CFLAGS ?= -DMG_ENABLE_LINES $(EXTRA)
2021-03-24 23:49:35 +08:00
ROOT ?= $(realpath $(CURDIR)/../..)
LIN = docker run -it --rm -v $(ROOT):$(ROOT) -w $(CURDIR) mdashnet/cc2
2020-12-10 21:26:05 +08:00
2021-01-30 21:03:11 +08:00
ifneq ($(MBEDTLS),)
2021-02-13 18:45:27 +08:00
CFLAGS += -DMG_ENABLE_MBEDTLS=1 -I$(MBEDTLS)/include -I/usr/include
CFLAGS += -L$(MBEDTLS)/lib -lmbedtls -lmbedcrypto -lmbedx509
2020-12-10 21:26:05 +08:00
endif
2021-01-30 21:03:11 +08:00
ifneq ($(OPENSSL),)
CFLAGS += -DMG_ENABLE_OPENSSL=1 -I$(OPENSSL)/include
CFLAGS += -L$(OPENSSL)/lib -lssl -lcrypto
endif
2020-12-10 21:26:05 +08:00
all: $(PROG)
$(DEBUGGER) ./$(PROG) $(ARGS)
$(PROG): main.c
$(CC) ../../mongoose.c -I../.. -W -Wall $(CFLAGS) -o $(PROG) main.c
2021-03-24 23:49:35 +08:00
linux: all
linux: CFLAGS += -O2 -g -fsanitize=address,undefined,shift,null,return,bounds,alignment,object-size,bool,enum -static-libasan
linux: CC = $(LIN) cc
linux: DEBUGGER = $(LIN)
2020-12-10 21:26:05 +08:00
clean:
rm -rf $(PROG) *.o *.dSYM *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb