Skip to content

Commit

Permalink
Add OS detection to Makefile to remove -lcrypt from libs and use -ins…
Browse files Browse the repository at this point in the history
…tall_name rather than -soname in LDFLAGS
  • Loading branch information
geoffgarside authored and dparrish committed Feb 13, 2011
1 parent ffe2840 commit 303677c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Makefile
@@ -1,3 +1,4 @@
UNAME = $(shell sh -c 'uname -s 2>/dev/null || echo not')
DESTDIR =
PREFIX = /usr/local

Expand All @@ -10,9 +11,15 @@ CC = gcc
DEBUG = -g
OPTIM = -O3
CFLAGS += $(DEBUG) $(OPTIM) -Wall -Wformat-security -Wno-format-zero-length
LDFLAGS += -shared -Wl,-soname,$(LIB).$(MAJOR).$(MINOR)
LDFLAGS += -shared
LIBPATH += -L.

ifeq ($(UNAME),Darwin)
LDFLAGS += -Wl,-install_name,$(LIB).$(MAJOR).$(MINOR)
else
LDFLAGS += -Wl,-soname,$(LIB).$(MAJOR).$(MINOR)
LIBS = -lcrypt
endif

all: $(LIB) clitest

Expand Down

0 comments on commit 303677c

Please sign in to comment.