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

Commit 4cefc0f

Browse files
ShaRoseindutny
authored andcommitted
makefile: fixed DESTDIR
Modified the Makefile so that it actually works. As it is now, symlinks will point to the fully qualified path of wherever your DESTDIR was: so one would end up with symlinks like: /usr/local/lib/libhttp_parser.so.2.7 pointing to: /tmp/http-parser-git/pkg/http-parser-git/usr/local/lib/libhttp_parser.so.2.7.1. This caused quite a bit of trouble when trying to package it, this patch makes it work. PR-URL: #391 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Fedor Indutny <[email protected]>
1 parent fd3850c commit 4cefc0f

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

Makefile

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ CFLAGS_LIB = $(CFLAGS_FAST) -fPIC
6161
LDFLAGS_LIB = $(LDFLAGS) -shared
6262

6363
INSTALL ?= install
64-
PREFIX ?= $(DESTDIR)/usr/local
64+
PREFIX ?= /usr/local
6565
LIBDIR = $(PREFIX)/lib
6666
INCLUDEDIR = $(PREFIX)/include
6767

@@ -131,20 +131,20 @@ tags: http_parser.c http_parser.h test.c
131131
ctags $^
132132

133133
install: library
134-
$(INSTALL) -D http_parser.h $(INCLUDEDIR)/http_parser.h
135-
$(INSTALL) -D $(LIBNAME) $(LIBDIR)/$(LIBNAME)
136-
ln -s $(LIBDIR)/$(LIBNAME) $(LIBDIR)/$(SONAME)
137-
ln -s $(LIBDIR)/$(LIBNAME) $(LIBDIR)/$(SOLIBNAME).$(SOEXT)
134+
$(INSTALL) -D http_parser.h $(DESTDIR)$(INCLUDEDIR)/http_parser.h
135+
$(INSTALL) -D $(LIBNAME) $(DESTDIR)$(LIBDIR)/$(LIBNAME)
136+
ln -s $(LIBDIR)/$(LIBNAME) $(DESTDIR)$(LIBDIR)/$(SONAME)
137+
ln -s $(LIBDIR)/$(LIBNAME) $(DESTDIR)$(LIBDIR)/$(SOLIBNAME).$(SOEXT)
138138

139139
install-strip: library
140-
$(INSTALL) -D http_parser.h $(INCLUDEDIR)/http_parser.h
141-
$(INSTALL) -D -s $(LIBNAME) $(LIBDIR)/$(LIBNAME)
142-
ln -s $(LIBDIR)/$(LIBNAME) $(LIBDIR)/$(SONAME)
143-
ln -s $(LIBDIR)/$(LIBNAME) $(LIBDIR)/$(SOLIBNAME).$(SOEXT)
140+
$(INSTALL) -D http_parser.h $(DESTDIR)$(INCLUDEDIR)/http_parser.h
141+
$(INSTALL) -D -s $(LIBNAME) $(DESTDIR)$(LIBDIR)/$(LIBNAME)
142+
ln -s $(LIBDIR)/$(LIBNAME) $(DESTDIR)$(LIBDIR)/$(SONAME)
143+
ln -s $(LIBDIR)/$(LIBNAME) $(DESTDIR)$(LIBDIR)/$(SOLIBNAME).$(SOEXT)
144144

145145
uninstall:
146-
rm $(INCLUDEDIR)/http_parser.h
147-
rm $(LIBDIR)/$(SONAME)
146+
rm $(DESTDIR)$(INCLUDEDIR)/http_parser.h
147+
rm $(DESTDIR)$(LIBDIR)/$(SONAME)
148148
rm $(LIBDIR)/libhttp_parser.so
149149

150150
clean:

0 commit comments

Comments
 (0)