Skip to content

Commit 34f85dd

Browse files
Updated Makefile
1 parent 58cac94 commit 34f85dd

File tree

1 file changed

+27
-14
lines changed

1 file changed

+27
-14
lines changed

‎Makefile‎

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,20 @@
55
## https://opensource.org/licenses/MIT
66
##
77

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+
818
PREFIX ?= /usr/local
919
BINDIR=$(PREFIX)/bin
1020
LIBDIR=$(PREFIX)/lib
21+
INCLUDEDIR=$(PREFIX)/include/sha1dc
1122

1223
CC ?= gcc
1324
LD ?= gcc
@@ -65,15 +76,17 @@ all: library tools
6576

6677
.PHONY: install
6778
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
7183

7284
.PHONY: uninstall
7385
uninstall:
7486
-$(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)
7790

7891
.PHONY: clean
7992
clean:
@@ -105,19 +118,19 @@ sha1dcsum_partialcoll: bin/sha1dcsum_partialcoll
105118

106119

107120
.PHONY: library
108-
library: bin/libdetectcoll.$(LIB_EXT)
121+
library: bin/libsha1detectcoll.$(LIB_EXT)
109122

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
112125

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)
115128

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
118131

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
121134

122135

123136
$(SRC_DEP_DIR)/%.d: $(SRC_DIR)/%.c

0 commit comments

Comments
(0)