cloudwu/pbc — Issue #1: Compiling problem on Linux
Author: zhanxw
Created: 2011-12-11 23:21:55+00:00
State: open

Cannot compile on ubuntu 11.10 (x86_64).
Propose following diff:

diff --git a/Makefile b/Makefile
index c71ed25..5b59879 100644
--- a/Makefile
+++ b/Makefile
@@ -39,7 +39,7 @@ define BUILD_temp
$$(TAR).o : | $(BUILD_O)
-include $$(TAR).d
$$(TAR).o : src/$(1)
- $(CC) $(CFLAGS) -c -Isrc -I. -o $$@ -MMD $$<
+ $(CC) $(CFLAGS) -c -Isrc -I. -fPIC -o $$@ -MMD $$<
endef

$(foreach s,$(LIBSRCS),$(eval $(call BUILD_temp,$(s))))
@@ -55,7 +55,7 @@ define TEST_temp
$$(TAR)$$(EXE) : | $(BUILD)
$$(TAR)$$(EXE) : | $(LIBNAME)
$$(TAR)$$(EXE) : test/$(1)
- cd $(BUILD) && $(CC) $(CFLAGS) -I.. -L. -lpbc -o $$(notdir $$@) ../$$<
+ cd $(BUILD) && $(CC) $(CFLAGS) -I.. -o $$(notdir $$@) ../$$< -L. -lpbc
endef

$(foreach s,$(TESTSRCS),$(eval $(call TEST_temp,$(s))))