[PATCH c-hglib] Makefile: create a shared library for c-hglib

Iulian Stana julian.stana at gmail.com
Fri Sep 20 18:23:15 CDT 2013


# HG changeset patch
# User Iulian Stana <julian.stana at gmail.com>
# Date 1379719378 -10800
#      Sat Sep 21 02:22:58 2013 +0300
# Node ID a4d8f4e048187eefff3a06f4c7b576f0c20fb262
# Parent  43bbd8b7a56b5a321bf073246225672ad7402461
Makefile: create a shared library for c-hglib

diff --git a/hglib/Makefile b/hglib/Makefile
new file mode 100644
--- /dev/null
+++ b/hglib/Makefile
@@ -0,0 +1,23 @@
+CC = gcc
+CFLAGS = -Wall -g -std=c89
+CHGLIB_OBJ= client.o utils.o
+SHARED_LIBRARY = chglib
+
+
+build: lib$(SHARED_LIBRARY).so
+
+lib$(SHARED_LIBRARY).so: $(CHGLIB_OBJ)
+	$(CC) -shared $(CHGLIB_OBJ) -o lib$(SHARED_LIBRARY).so -lrt
+
+client.o: client.c
+	$(CC) $(CFLAGS) -fPIC -c $<
+
+utils.o: utils.c
+	$(CC) $(CFLAGS) -fPIC -c $<
+
+
+.PHONY: clean
+
+clean:
+	rm -f *.o *~ lib$(SHARED_LIBRARY).so
+


More information about the Mercurial-devel mailing list