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

login
register
mail settings
Submitter Iulian Stana
Date Sept. 20, 2013, 11:23 p.m.
Message ID <a4d8f4e048187eefff3a.1379719395@doppler>
Download mbox | patch
Permalink /patch/2585/
State Deferred
Headers show

Comments

Iulian Stana - Sept. 20, 2013, 11:23 p.m.
# HG changeset patch
# User Iulian Stana <julian.stana@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
Giovanni Gherdovich - Sept. 21, 2013, 9:26 a.m.
2013/9/21 Iulian Stana <julian.stana@gmail.com>:
> # HG changeset patch
> # User Iulian Stana <julian.stana@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
> +
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel


"[PATCH 1 of 9 c-hglib]"  <---- not good. The plan is to send
one changeset at a time, not a 9-sized series of changeset.

More over, I would prefer that you add the Makefile as the very last thing,
after all level0 is committed to the official repo.

The reason is that i'd like the Makefile to have a target "examples"
and "test", which respectively builds examples and runs tests,
and those components has not been reviewed yet and potentially subjected
to chages.

long story short: at this stage we don't know yet
what the Makefile is gonna look like.

GGhh
Giovanni Gherdovich - Sept. 21, 2013, 3:52 p.m.
2013/9/21 Iulian Stana <julian.stana@gmail.com>:
> # HG changeset patch
> # User Iulian Stana <julian.stana@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


wait a sec Iulian, why oh why are you linking against librt.so ?
it's for asynch I/O, see `man 7 aio` and `man 3 aio_write`.
You shouldn't need that AFAICT.


> +
> +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
> +
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

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
+