mongoose/examples/api_server/Makefile
Alexander Alashkin df311203dc Fix mongoose/examples compilation with mingw
PUBLISHED_FROM=46800f43ba03082cc589d70e6118d754f4cdc9d0
2016-03-10 13:11:22 +01:00

29 lines
547 B
Makefile

PROG = api_server
SOURCES = $(PROG).c sqlite3.c db_plugin_sqlite.c ../../mongoose.c
CFLAGS = -W -Wall $(CFLAGS_EXTRA)
ifeq ($(OS), Windows_NT)
CFLAGS += -lws2_32 -D_MG_PROVIDE_STRNLEN
CC = mingw32-gcc
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S), Linux)
CFLAGS += -ldl -lm -pthread
endif
endif
all: $(PROG)
$(PROG): $(SOURCES)
$(CC) $(SOURCES) -o $@ $(CFLAGS)
$(PROG).exe: $(SOURCES)
cl $(SOURCES) /I.. /MD /Fe$@
test: $(PROG)
sh unit_test.sh $$(pwd)/$(PROG)
clean:
rm -rf *.gc* *.dSYM *.exe *.obj *.o a.out $(PROG)