|
5 | 5 | ## https://opensource.org/licenses/MIT |
6 | 6 | ## |
7 | 7 |
|
| 8 | +# dynamic library compatibility |
| 9 | +# 1. If the library source code has changed at all since the last update, |
| 10 | +# then increment revision (‘c:r:a’ becomes ‘c:r+1:a’). |
| 11 | +# 2. If any interfaces have been added, removed, or changed since the last update, |
| 12 | +# increment current, and set revision to 0. |
| 13 | +# 3. If any interfaces have been added since the last public release, then increment age. |
| 14 | +# 4. If any interfaces have been removed or changed since the last public release, |
| 15 | +# then set age to 0. |
| 16 | +LIBCOMPAT=0:0:0 |
| 17 | + |
8 | 18 | PREFIX ?= /usr/local |
9 | 19 | BINDIR=$(PREFIX)/bin |
10 | 20 | LIBDIR=$(PREFIX)/lib |
| 21 | +INCLUDEDIR=$(PREFIX)/include/sha1dc |
11 | 22 |
|
12 | 23 | CC ?= gcc |
13 | 24 | LD ?= gcc |
@@ -65,15 +76,17 @@ all: library tools |
65 | 76 |
|
66 | 77 | .PHONY: install |
67 | 78 | install: all |
68 | | -$(INSTALL) bin/libdetectcoll.$(LIB_EXT)$(LIBDIR) |
69 | | -$(INSTALL) bin/sha1dcsum $(BINDIR) |
70 | | -# $(INSTALL) bin/sha1dcsum_partialcoll $(BINDIR) |
| 79 | +$(INSTALL) -D bin/libsha1detectcoll.$(LIB_EXT)$(LIBDIR)/libsha1detectcoll.$(LIB_EXT) |
| 80 | +$(INSTALL) -D lib/sha1.h $(INCLUDEDIR)/sha1.h |
| 81 | +$(INSTALL) -D bin/sha1dcsum $(BINDIR)/sha1dcsum |
| 82 | +$(INSTALL) -D bin/sha1dcsum_partialcoll $(BINDIR)/sha1dcsum_partialcoll |
71 | 83 |
|
72 | 84 | .PHONY: uninstall |
73 | 85 | uninstall: |
74 | 86 | -$(RM)$(BINDIR)/sha1dcsum |
75 | | - -$(RM)$(LIBDIR)/libdetectcoll.$(LIB_EXT) |
76 | | -# -$(RM) $(BINDIR)/sha1dcsum_partialcoll |
| 87 | + -$(RM)$(BINDIR)/sha1dcsum_partialcoll |
| 88 | + -$(RM)$(INCLUDEDIR)/sha1.h |
| 89 | + -$(RM)$(LIBDIR)/libsha1detectcoll.$(LIB_EXT) |
77 | 90 |
|
78 | 91 | .PHONY: clean |
79 | 92 | clean: |
@@ -105,19 +118,19 @@ sha1dcsum_partialcoll: bin/sha1dcsum_partialcoll |
105 | 118 |
|
106 | 119 |
|
107 | 120 | .PHONY: library |
108 | | -library: bin/libdetectcoll.$(LIB_EXT) |
| 121 | +library: bin/libsha1detectcoll.$(LIB_EXT) |
109 | 122 |
|
110 | | -bin/libdetectcoll.la: $(FS_OBJ_LIB) |
111 | | -$(MKDIR)$(shell dirname $@)&&$(LDLIB)$(LDFLAGS)$(FS_OBJ_LIB) -rpath $(LIBDIR) -o bin/libdetectcoll.la |
| 123 | +bin/libsha1detectcoll.la: $(FS_OBJ_LIB) |
| 124 | +$(MKDIR)$(shell dirname $@)&&$(LDLIB)$(LDFLAGS)$(FS_OBJ_LIB) -rpath $(LIBDIR) -version-info $(LIBCOMPAT) -o bin/libsha1detectcoll.la |
112 | 125 |
|
113 | | -bin/libdetectcoll.a: $(FS_OBJ_LIB) |
114 | | -$(MKDIR)$(shell dirname $@)&&$(AR) cru bin/libdetectcoll.a $(FS_OBJ_LIB) |
| 126 | +bin/libsha1detectcoll.a: $(FS_OBJ_LIB) |
| 127 | +$(MKDIR)$(shell dirname $@)&&$(AR) cru bin/libsha1detectcoll.a $(FS_OBJ_LIB) |
115 | 128 |
|
116 | | -bin/sha1dcsum: $(FS_OBJ_SRC) bin/libdetectcoll.$(LIB_EXT) |
117 | | -$(LD)$(LDFLAGS)$(FS_OBJ_SRC) -Lbin -ldetectcoll -o bin/sha1dcsum |
| 129 | +bin/sha1dcsum: $(FS_OBJ_SRC) bin/libsha1detectcoll.$(LIB_EXT) |
| 130 | +$(LD)$(LDFLAGS)$(FS_OBJ_SRC) -Lbin -lsha1detectcoll -o bin/sha1dcsum |
118 | 131 |
|
119 | | -bin/sha1dcsum_partialcoll: $(FS_OBJ_SRC) bin/libdetectcoll.$(LIB_EXT) |
120 | | -$(LD)$(LDFLAGS)$(FS_OBJ_SRC) -Lbin -ldetectcoll -o bin/sha1dcsum_partialcoll |
| 132 | +bin/sha1dcsum_partialcoll: $(FS_OBJ_SRC) bin/libsha1detectcoll.$(LIB_EXT) |
| 133 | +$(LD)$(LDFLAGS)$(FS_OBJ_SRC) -Lbin -lsha1detectcoll -o bin/sha1dcsum_partialcoll |
121 | 134 |
|
122 | 135 |
|
123 | 136 | $(SRC_DEP_DIR)/%.d: $(SRC_DIR)/%.c |
|
0 commit comments