projects
/
project
/
libubox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e82d74f
)
compile a subset on darwin
author
Felix Fietkau
<nbd@openwrt.org>
Fri, 3 Dec 2010 18:16:10 +0000
(19:16 +0100)
committer
Felix Fietkau
<nbd@openwrt.org>
Fri, 3 Dec 2010 18:16:10 +0000
(19:16 +0100)
.gitignore
patch
|
blob
|
history
Makefile
patch
|
blob
|
history
diff --git
a/.gitignore
b/.gitignore
index
140f8cf
..
9784b6a
100644
(file)
--- a/
.gitignore
+++ b/
.gitignore
@@
-1
+1,2
@@
*.so
*.so
+*.dylib
diff --git
a/Makefile
b/Makefile
index
8af237d
..
3c0399a
100644
(file)
--- a/
Makefile
+++ b/
Makefile
@@
-8,10
+8,23
@@
INCLUDE_DIR=$(PREFIX)/include/libubox
LIBDIR=$(PREFIX)/lib
CPPFLAGS=
LIBDIR=$(PREFIX)/lib
CPPFLAGS=
-all: libubox.so
+OS=$(shell uname)
+FILES=blob.c blobmsg.c hash.c uhtbl.c
+ifeq ($(OS),Linux)
+ FILES += ucix.c usock.c uloop.c unl.c
+ LIBS += -luci $(LIBNL)
+ LDFLAGS_SHARED=-shared -Wl,-soname,$@
+ SHLIB_EXT=so
+endif
+ifeq ($(OS),Darwin)
+ LDFLAGS_SHARED=-dynamiclib
+ SHLIB_EXT=dylib
+endif
-libubox.so: ucix.c blob.c blobmsg.c hash.c uhtbl.c usock.c uloop.c unl.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -shared -Wl,-soname,libubox.so $^ $(LDFLAGS) -luci $(LIBNL)
+all: libubox.$(SHLIB_EXT)
+
+libubox.$(SHLIB_EXT): $(FILES)
+ $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS) $(LDFLAGS_SHARED)
install-headers:
mkdir -p $(INCLUDE_DIR)
install-headers:
mkdir -p $(INCLUDE_DIR)
@@
-19,10
+32,10
@@
install-headers:
install-lib:
mkdir -p $(LIBDIR)
install-lib:
mkdir -p $(LIBDIR)
- cp libubox.
so
$(LIBDIR)/
+ cp libubox.
$(SHLIB_EXT)
$(LIBDIR)/
install: install-lib install-headers
clean:
install: install-lib install-headers
clean:
- rm -f *.
so
+ rm -f *.
$(SHLIB_EXT)