1 PLATFORM=$(shell uname -s)
3 ifneq (,$(CROSS_COMPILE))
4 PREFIX=$(CROSS_COMPILE)-
10 ifneq (,$(findstring MINGW32,$(PLATFORM)))
13 ifneq (,$(findstring mingw,$(CROSS_COMPILE)))
19 RANLIB=$(PREFIX)ranlib
31 INCLUDES= -I. -Isrc -Iinclude -Ideps/http-parser -Ideps/zlib
33 DEFINES= $(INCLUDES) -DNO_VIZ -DSTDC -DNO_GZIP -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $(EXTRA_DEFINES)
34 CFLAGS= -g $(DEFINES) -Wall -Wextra -Wno-missing-field-initializers -O2 $(EXTRA_CFLAGS)
36 SRCS = $(wildcard src/*.c) $(wildcard src/transports/*.c) $(wildcard src/xdiff/*.c) $(wildcard deps/http-parser/*.c) $(wildcard deps/zlib/*.c) src/hash/hash_generic.c
39 SRCS += $(wildcard src/win32/*.c) $(wildcard src/compat/*.c) deps/regex/regex.c
40 INCLUDES += -Ideps/regex
41 DEFINES += -DWIN32 -D_WIN32_WINNT=0x0501 -D__USE_MINGW_ANSI_STDIO=1
43 SRCS += $(wildcard src/unix/*.c)
47 OBJS = $(patsubst %.c,%.o,$(SRCS))
50 $(CC) $(CFLAGS) -c $*.c
60 $(rm) $(OBJS) $(LIBNAME)