2015-09-08 19:49:03 +08:00
|
|
|
PROG = api_server
|
|
|
|
SOURCES = $(PROG).c sqlite3.c db_plugin_sqlite.c ../../mongoose.c
|
2016-03-08 19:27:34 +08:00
|
|
|
CFLAGS = -W -Wall $(CFLAGS_EXTRA)
|
|
|
|
|
2015-09-08 19:49:03 +08:00
|
|
|
|
|
|
|
ifeq ($(OS), Windows_NT)
|
2016-03-08 19:27:34 +08:00
|
|
|
CFLAGS += -lws2_32 -D_MG_PROVIDE_STRNLEN
|
2016-03-09 17:59:32 +08:00
|
|
|
CC = gcc
|
2015-09-08 19:49:03 +08:00
|
|
|
else
|
|
|
|
UNAME_S := $(shell uname -s)
|
|
|
|
ifeq ($(UNAME_S), Linux)
|
2016-03-08 19:27:34 +08:00
|
|
|
CFLAGS += -ldl -lm -pthread
|
2015-09-08 19:49:03 +08:00
|
|
|
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)
|