Skip to content
This repository was archived by the owner on Nov 6, 2022. It is now read-only.

Commit 2896229

Browse files
guoxiaoindutny
authored andcommitted
make: fix dynamic library extension for OS X
1 parent 39c2c1e commit 2896229

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Makefile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,13 @@
1919
# IN THE SOFTWARE.
2020

2121
PLATFORM ?= $(shell sh -c 'uname -s | tr "[A-Z]" "[a-z]"')
22+
ifeq (darwin,$(PLATFORM))
23+
SONAME ?= libhttp_parser.2.5.0.dylib
24+
SOEXT ?= dylib
25+
else
2226
SONAME ?= libhttp_parser.so.2.5.0
23-
27+
SOEXT ?= so
28+
endif
2429
CC?=gcc
2530
AR?=ar
2631

@@ -113,12 +118,12 @@ tags: http_parser.c http_parser.h test.c
113118
install: library
114119
$(INSTALL) -D http_parser.h $(INCLUDEDIR)/http_parser.h
115120
$(INSTALL) -D $(SONAME) $(LIBDIR)/$(SONAME)
116-
ln -s $(LIBDIR)/$(SONAME) $(LIBDIR)/libhttp_parser.so
121+
ln -s $(LIBDIR)/$(SONAME) $(LIBDIR)/libhttp_parser.$(SOEXT)
117122

118123
install-strip: library
119124
$(INSTALL) -D http_parser.h $(INCLUDEDIR)/http_parser.h
120125
$(INSTALL) -D -s $(SONAME) $(LIBDIR)/$(SONAME)
121-
ln -s $(LIBDIR)/$(SONAME) $(LIBDIR)/libhttp_parser.so
126+
ln -s $(LIBDIR)/$(SONAME) $(LIBDIR)/libhttp_parser.$(SOEXT)
122127

123128
uninstall:
124129
rm $(INCLUDEDIR)/http_parser.h

0 commit comments

Comments
 (0)