]> git.proxmox.com Git - libgit2.git/blob - Makefile.embed
Allow passing additional defines and cflags to Makefile.embed.
[libgit2.git] / Makefile.embed
1 rm=rm -f
2 CC=cc
3 AR=ar cq
4 RANLIB=ranlib
5 LIBNAME=libgit2.a
6
7 INCLUDES= -I. -Isrc -Iinclude -Ideps/http-parser -Ideps/zlib
8
9 DEFINES= $(INCLUDES) -DNO_VIZ -DSTDC -DNO_GZIP -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $(EXTRA_DEFINES)
10 CFLAGS= -g $(DEFINES) -Wall -Wextra -fPIC -O2 $(EXTRA_CFLAGS)
11
12 SRCS = $(wildcard src/*.c) $(wildcard src/transports/*.c) $(wildcard src/unix/*.c) $(wildcard src/xdiff/*.c) $(wildcard deps/http-parser/*.c) $(wildcard deps/zlib/*.c)
13 OBJS = $(patsubst %.c,%.o,$(SRCS))
14
15 %.c.o:
16 $(CC) $(CFLAGS) -c $*.c
17
18 all: $(LIBNAME)
19
20 $(LIBNAME): $(OBJS)
21 $(rm) $@
22 $(AR) $@ $(OBJS)
23 $(RANLIB) $@
24
25 clean:
26 $(rm) $(OBJS) $(LIBNAME)