1 | | --- Makefile.org 2014-03-10 23:12:11.000000000 -0700 |
2 | | +++ Makefile 2014-03-10 23:33:10.000000000 -0700 |
3 | | @@ -22,20 +22,24 @@ |
4 | | CFLAGS += -DUSE_SYS_DYN_MEM |
5 | | endif |
6 | | |
7 | | -LDFLAGS += -shared |
8 | | - |
9 | | PREFIX ?= /usr |
10 | | DESTDIR ?= |
11 | | -INCDIR = $(DESTDIR)$(PREFIX)/include |
12 | | +INCDIR = $(PREFIX)/include |
13 | | |
14 | | -LIBDIR = $(DESTDIR)$(PREFIX)/lib |
15 | | +UNAME_S := $(shell uname -s) |
16 | | +ifeq ($(UNAME_S),Darwin) |
17 | | +LDFLAGS += -dynamiclib -install_name $(LIBDIR)/$(LIBRARY) |
18 | | +else |
19 | | +LDFLAGS += -shared |
20 | | +endif |
21 | | + |
22 | | + |
23 | | +LIBDIR = $(PREFIX)/lib |
24 | | # on x86_64, we might have /usr/lib64 directory instead of /usr/lib |
25 | | UNAME_M := $(shell uname -m) |
26 | | ifeq ($(UNAME_M), x86_64) |
27 | | ifeq (,$(wildcard $(LIBDIR))) |
28 | | -LIBDIR = $(DESTDIR)$(PREFIX)/lib64 |
29 | | -else |
30 | | -LIBDIR = $(DESTDIR)$(PREFIX)/lib |
31 | | +LIBDIR = $(PREFIX)/lib64 |
32 | | endif |
33 | | endif |
34 | | |
35 | | @@ -138,7 +142,6 @@ |
36 | | LIBOBJ += MCInst.o |
37 | | |
38 | | |
39 | | -UNAME_S := $(shell uname -s) |
40 | | PKGCFCGDIR = $(LIBDIR)/pkgconfig |
41 | | |
42 | | # OSX? |
43 | | @@ -149,13 +152,6 @@ |
44 | | # remove string check because OSX kernel complains about missing symbols |
45 | | CFLAGS += -D_FORTIFY_SOURCE=0 |
46 | | endif |
| 1 | --- Makefile.org 2014-04-01 06:08:49.000000000 -0700 |
| 2 | +++ Makefile 2014-04-01 06:27:43.000000000 -0700 |
| 3 | @@ -163,19 +163,6 @@ |
| 4 | VERSION_EXT = $(API_MAJOR).$(EXT) |
| 5 | LDFLAGS += -dynamiclib -install_name lib$(LIBNAME).$(VERSION_EXT) -current_version $(PKG_MAJOR).$(PKG_MINOR).$(PKG_EXTRA) -compatibility_version $(PKG_MAJOR).$(PKG_MINOR) |
| 6 | AR_EXT = a |
| 7 | -ifneq ($(HOMEBREW_CAPSTONE),1) |
| 8 | -ifneq ($(USE_SYS_DYN_MEM),yes) |
| 9 | -# remove string check because OSX kernel complains about missing symbols |
| 10 | -CFLAGS += -D_FORTIFY_SOURCE=0 |
| 11 | -endif |
68 | | - mkdir -p $(LIBDIR) |
69 | | - $(INSTALL_LIBRARY) lib$(LIBNAME).$(EXT) $(LIBDIR) |
70 | | - $(INSTALL_DATA) lib$(LIBNAME).$(AR_EXT) $(LIBDIR) |
71 | | - mkdir -p $(INCDIR)/$(LIBNAME) |
72 | | - $(INSTALL_DATA) include/*.h $(INCDIR)/$(LIBNAME) |
73 | | - mkdir -p $(PKGCFCGDIR) |
74 | | - $(INSTALL_DATA) $(PKGCFGF) $(PKGCFCGDIR)/ |
75 | | + mkdir -p $(DESTDIR)$(LIBDIR) |
76 | | + $(INSTALL_LIBRARY) lib$(LIBNAME).$(EXT) $(DESTDIR)$(LIBDIR) |
77 | | + $(INSTALL_DATA) lib$(LIBNAME).$(AR_EXT) $(DESTDIR)$(LIBDIR) |
78 | | + mkdir -p $(DESTDIR)$(INCDIR)/$(LIBNAME) |
79 | | + $(INSTALL_DATA) include/*.h $(DESTDIR)$(INCDIR)/$(LIBNAME) |
80 | | + mkdir -p $(DESTDIR)$(PKGCFCGDIR) |
81 | | + $(INSTALL_DATA) $(PKGCFGF) $(DESTDIR)$(PKGCFCGDIR)/ |
82 | | |
83 | | uninstall: |
84 | | - rm -rf $(INCDIR)/$(LIBNAME) |
85 | | - rm -f $(LIBDIR)/lib$(LIBNAME).$(EXT) |
86 | | - rm -f $(LIBDIR)/lib$(LIBNAME).$(AR_EXT) |
87 | | - rm -f $(PKGCFCGDIR)/$(LIBNAME).pc |
88 | | + rm -rf $(DESTDIR)$(INCDIR)/$(LIBNAME) |
89 | | + rm -f $(DESTDIR)$(LIBDIR)/lib$(LIBNAME).$(EXT) |
90 | | + rm -f $(DESTDIR)$(LIBDIR)/lib$(LIBNAME).$(AR_EXT) |
91 | | + rm -f $(DESTDIR)$(PKGCFCGDIR)/$(LIBNAME).pc |
92 | | |
93 | | clean: |
94 | | rm -f $(LIBOBJ) lib$(LIBNAME).* |
| 34 | mkdir -p $(LIBDIR) |
| 35 | - # remove potential broken old libs |
| 36 | - rm -f $(LIBDIR)/lib$(LIBNAME).* |
| 37 | $(INSTALL_LIB) lib$(LIBNAME).$(EXT) $(LIBDIR) |
| 38 | ifneq ($(VERSION_EXT),) |
| 39 | cd $(LIBDIR) && \ |