diff --git a/Makefile.config b/Makefile.config index 4ef21327..06d13852 100644 --- a/Makefile.config +++ b/Makefile.config @@ -10,7 +10,7 @@ CYC_PROFILING ?= CYC_GCC_OPT_FLAGS ?= -O2 #CYC_GCC_OPT_FLAGS ?= -g -OS ?= $(shell uname) +OS = $(shell uname) CC ?= cc LIBS = -pthread -lcyclone -lck -lm -ltommath @@ -21,22 +21,32 @@ endif # Compiler options CFLAGS ?= $(CYC_PROFILING) $(CYC_GCC_OPT_FLAGS) -fPIC -Wall -Iinclude -COMP_CFLAGS ?= $(CYC_PROFILING) $(CYC_GCC_OPT_FLAGS) -fPIC -Wall -I$(PREFIX)/include -L$(PREFIX)/lib +BASE_CFLAGS ?= $(CYC_PROFILING) $(CYC_GCC_OPT_FLAGS) -fPIC -Wall -I$(PREFIX)/include +ifeq ($(OS),Darwin) +COMP_CFLAGS ?= $(BASE_CFLAGS) +else +COMP_CFLAGS ?= $(BASE_CFLAGS) -L$(PREFIX)/lib +endif + # Use these lines instead for debugging or profiling #CFLAGS = -g -Wall #CFLAGS = -g -pg -Wall # Linker options LDFLAGS ?= -L. $(CYC_PROFILING) +LIBRARY_OUTPUT_FILE = libcyclone.a ifeq ($(OS),Darwin) -LDFLAGS += -Wl,-export_dynamic -Wl,-undefined -Wl,dynamic_lookup -COMP_CFLAGS += -Wl,-export_dynamic +LDFLAGS += -Wl,-undefined -Wl,dynamic_lookup +CREATE_LIBRARY_COMMAND = $(LIBTOOL) +CREATE_LIBRARY_FLAGS = -static -o else LDFLAGS += -Wl,--export-dynamic COMP_CFLAGS += -Wl,--export-dynamic +CREATE_LIBRARY_COMMAND = $(AR) +CREATE_LIBRARY_FLAGS = rcs endif -# /usr/local is not in the search path by default on FreeBSD, so if libtommath and/or +# /usr/local is not in the search path by default on FreeBSD, so if libtommath and/or # concurrencykit was installed via Ports, it won't be picked up without explicitly looking # for it here ifeq ($(OS),FreeBSD) @@ -44,6 +54,7 @@ LDFLAGS += -L/usr/local/lib CFLAGS += -I/usr/local/include endif + # Commands "baked into" cyclone for invoking the C compiler CC_PROG ?= "$(CC) ~src-file~ $(COMP_CFLAGS) -c -o ~exec-file~.o" CC_EXEC ?= "$(CC) ~exec-file~.o ~obj-files~ $(LIBS) $(COMP_CFLAGS) -o ~exec-file~" @@ -51,6 +62,7 @@ CC_LIB ?= "$(CC) ~src-file~ $(COMP_CFLAGS) -c -o ~exec-file~.o" CC_SO ?= "$(CC) -shared $(LDFLAGS) -o ~exec-file~.so ~exec-file~.o" AR ?= ar +LIBTOOL ?= libtool #CD ?= cd RM ?= rm -f #LS ?= ls diff --git a/Makefile.config.raspberry-pi-2 b/Makefile.config.raspberry-pi-2 index dd857d22..f4d21f28 100644 --- a/Makefile.config.raspberry-pi-2 +++ b/Makefile.config.raspberry-pi-2 @@ -13,6 +13,10 @@ ifneq ($(OS),FreeBSD) LIBS += -ldl endif +LIBRARY_OUTPUT_FILE = libcyclone.a +CREATE_LIBRARY_COMMAND = $(AR) +CREATE_LIBRARY_FLAGS = rcs + # Compiler options CFLAGS ?= -O2 -fPIC -Wall -march=armv6k -Iinclude COMP_CFLAGS ?= -O2 -fPIC -Wall -march=armv6k -I$(PREFIX)/include -L$(PREFIX)/lib