Commit d4043ee9 by Andreas Ericsson Committed by Shawn O. Pearce

Move public headers to src/git

It's arguably smoother to keep them close to the source,
as that's where one's working when modifying them. More
importantly, though, is the ability to use private headers
in the src/ dir that simply include "git/$samename.h" to
get to the public API at the same time.

Signed-off-by: Andreas Ericsson <ae@op5.se>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
parent 1b9e92c7
/apidocs /apidocs
/include/git/config.h /src/git/config.h
*.o *.o
*.a *.a
*.exe *.exe
...@@ -5,16 +5,18 @@ DOXYGEN = doxygen ...@@ -5,16 +5,18 @@ DOXYGEN = doxygen
CFLAGS = -g -O2 -Wall CFLAGS = -g -O2 -Wall
OS = unix OS = unix
BASIC_CFLAGS := -Iinclude BASIC_CFLAGS := -Isrc
BASIC_CFLAGS += -DGIT__PRIVATE BASIC_CFLAGS += -DGIT__PRIVATE
BASIC_CFLAGS += -fvisibility=hidden BASIC_CFLAGS += -fvisibility=hidden
OBJS = $(patsubst %.c,%.o,$(wildcard src/*.c)) OBJS = $(patsubst %.c,%.o,$(wildcard src/*.c))
HDRS = $(wildcard include/git/*.h) HDRS = $(wildcard src/*.h)
PUBLIC_HEADERS = $(wildcard src/git/*.h)
HDRS += $(PUBLIC_HEADERS)
OBJS += src/os/$(OS).o OBJS += src/os/$(OS).o
HDRS += include/git/config.h HDRS += src/git/config.h
HDRS += include/git/os/$(OS).h HDRS += src/git/os/$(OS).h
GIT_LIB = libgit2.a GIT_LIB = libgit2.a
...@@ -29,7 +31,7 @@ clean: ...@@ -29,7 +31,7 @@ clean:
rm -f $(GIT_LIB) rm -f $(GIT_LIB)
rm -f src/*.o rm -f src/*.o
rm -f tests/*.o tests/*.exe tests/*.toc rm -f tests/*.o tests/*.exe tests/*.toc
rm -f include/git/config.h rm -f src/git/config.h
rm -rf apidocs rm -rf apidocs
apidocs: apidocs:
...@@ -41,7 +43,7 @@ test: $(TEST_RUN) ...@@ -41,7 +43,7 @@ test: $(TEST_RUN)
.c.o: .c.o:
$(CC) $(BASIC_CFLAGS) $(CFLAGS) -c $< -o $@ $(CC) $(BASIC_CFLAGS) $(CFLAGS) -c $< -o $@
include/git/config.h: include/git/config.h.in src/git/config.h: src/git/config.h.in
sed 's/@@OS@@/$(OS)/g' $< >$@+ sed 's/@@OS@@/$(OS)/g' $< >$@+
mv $@+ $@ mv $@+ $@
...@@ -62,12 +64,12 @@ $(patsubst %.exe,%.toc,$(TEST_EXE)): tests/%.toc: tests/%.c ...@@ -62,12 +64,12 @@ $(patsubst %.exe,%.toc,$(TEST_EXE)): tests/%.toc: tests/%.c
mv $@+ $@ mv $@+ $@
$(TEST_OBJ): tests/%.o: tests/%.c $(TEST_OBJ): tests/%.o: tests/%.c
$(CC) -Iinclude $(CFLAGS) -c $< -o $@ $(CC) -Isrc $(CFLAGS) -c $< -o $@
$(patsubst %.exe,%_main.o,$(TEST_EXE)): tests/%_main.o: $(HDRS) $(patsubst %.exe,%_main.o,$(TEST_EXE)): tests/%_main.o: $(HDRS)
$(patsubst %.exe,%_main.o,$(TEST_EXE)): tests/%_main.o: $(T_MAIN_C) $(patsubst %.exe,%_main.o,$(TEST_EXE)): tests/%_main.o: $(T_MAIN_C)
$(patsubst %.exe,%_main.o,$(TEST_EXE)): tests/%_main.o: tests/%.toc $(patsubst %.exe,%_main.o,$(TEST_EXE)): tests/%_main.o: tests/%.toc
$(CC) -Iinclude -I. '-DTEST_TOC="$<"' \ $(CC) -Isrc -I. '-DTEST_TOC="$<"' \
-c $(T_MAIN_C) \ -c $(T_MAIN_C) \
-o $@ -o $@
......
...@@ -46,7 +46,7 @@ GIT_BEGIN_DECL ...@@ -46,7 +46,7 @@ GIT_BEGIN_DECL
* deflateBound() implementation itself. * deflateBound() implementation itself.
* *
* @param stream the stream pointer. * @param stream the stream pointer.
* @param s total length of the source data (in bytes). * @param s total length of the source data (in bytes).
* @return maximum length of the compressed data. * @return maximum length of the compressed data.
*/ */
GIT_INLINE(size_t) deflateBound(z_streamp stream, size_t s) GIT_INLINE(size_t) deflateBound(z_streamp stream, size_t s)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment