[RFC PATCH 1/3] test: add simple shared library

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It doesn't contain anything, it's just preparation for further commits.

Signed-off-by: Felipe Contreras <felipe.contreras@xxxxxxxxx>
---
 .gitignore  | 1 +
 t/Makefile  | 9 +++++++++
 t/lib/git.c | 1 +
 t/lib/git.h | 4 ++++
 4 files changed, 15 insertions(+)
 create mode 100644 t/lib/git.c
 create mode 100644 t/lib/git.h

diff --git a/.gitignore b/.gitignore
index e875c59054..c249487b9d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -237,6 +237,7 @@
 *.iobj
 *.ipdb
 *.dll
+*.so
 .vs/
 Debug/
 Release/
diff --git a/t/Makefile b/t/Makefile
index 3e00cdd801..d85e3e661d 100644
--- a/t/Makefile
+++ b/t/Makefile
@@ -65,6 +65,15 @@ prove: pre-clean check-chainlint $(TEST_LINT)
 $(T):
 	@echo "*** $@ ***"; '$(TEST_SHELL_PATH_SQ)' $@ $(GIT_TEST_OPTS)
 
+lib/git.o: lib/git.c
+	$(QUIET_CC)$(COMPILE.c) -o $@ $<
+
+lib/libgit.so: CFLAGS := -fPIC -Ilib/ $(CFLAGS)
+lib/libgit.so: lib/git.o
+
+%.so::
+	$(QUIET_LINK)$(CC) -shared -o $@ $^ $(LIBS)
+
 pre-clean:
 	$(RM) -r '$(TEST_RESULTS_DIRECTORY_SQ)'
 
diff --git a/t/lib/git.c b/t/lib/git.c
new file mode 100644
index 0000000000..40d96ee354
--- /dev/null
+++ b/t/lib/git.c
@@ -0,0 +1 @@
+#include <git.h>
diff --git a/t/lib/git.h b/t/lib/git.h
new file mode 100644
index 0000000000..58a28085f5
--- /dev/null
+++ b/t/lib/git.h
@@ -0,0 +1,4 @@
+#ifndef GIT_H
+#define GIT_H
+
+#endif /* GIT_H */
-- 
2.40.0+fc1




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux