mirror of
https://github.com/troglobit/libite.git
synced 2026-11-12 16:51:16 +00:00
Cleanup: Fix install/uninstall of both static and dynamic builds.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
c045bc7264
commit
262f8b8936
1 file changed
+13
-9
@@ -36,7 +36,7 @@ STRIP ?= $(CROSS)strip
|
|||||||
INSTALL := install --backup=off
|
INSTALL := install --backup=off
|
||||||
STRIPINST := $(INSTALL) -s --strip-program=$(CROSS)strip -m 0755
|
STRIPINST := $(INSTALL) -s --strip-program=$(CROSS)strip -m 0755
|
||||||
|
|
||||||
ifneq ($(STATIC), 1)
|
ifndef STATIC
|
||||||
CFLAGS += -fPIC
|
CFLAGS += -fPIC
|
||||||
endif
|
endif
|
||||||
CFLAGS += -Os
|
CFLAGS += -Os
|
||||||
@@ -79,7 +79,7 @@ $(OBJS): Makefile
|
|||||||
|
|
||||||
$(SOLIB): Makefile $(OBJS)
|
$(SOLIB): Makefile $(OBJS)
|
||||||
@printf " LINK %s\n" $@
|
@printf " LINK %s\n" $@
|
||||||
@$(CC) $(LDFLAGS) -shared -Wl,-soname,$@ -o $@ $(OBJS) -lrt -lcrypt
|
@$(CC) $(LDFLAGS) -shared -Wl,-soname,$@ -o $@ $(OBJS)
|
||||||
|
|
||||||
$(STATICLIB): Makefile $(OBJS)
|
$(STATICLIB): Makefile $(OBJS)
|
||||||
@printf " ARCHIVE $@\n"
|
@printf " ARCHIVE $@\n"
|
||||||
@@ -94,26 +94,30 @@ ifndef STATIC
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
install-dev:
|
install-dev:
|
||||||
@install -d $(DESTDIR)$(incdir)
|
@install -d $(DESTDIR)$(incdir)/$(LIBNAME)
|
||||||
@for file in $(HEADERS); do \
|
@for file in $(HEADERS); do \
|
||||||
printf " INSTALL $(DESTDIR)$(incdir)/$$file\n"; \
|
printf " INSTALL $(DESTDIR)$(incdir)/$(LIBNAME)/$$file\n"; \
|
||||||
$(INSTALL) -m 0644 $$file $(DESTDIR)$(incdir)/$$file; \
|
$(INSTALL) -m 0644 $$file $(DESTDIR)$(incdir)/$(LIBNAME)/$$file; \
|
||||||
done
|
done
|
||||||
ifdef STATIC
|
ifdef STATIC
|
||||||
@printf " INSTALL $(DESTDIR)$(libdir)/$(STATICLIB)\n"
|
@printf " INSTALL $(DESTDIR)$(libdir)/$(STATICLIB)\n"
|
||||||
@install -d $(DESTDIR)$(libdir)
|
@install -d $(DESTDIR)$(libdir)
|
||||||
@$(INSTALL) $(STATICLIB) $(DESTDIR)$(libdir)/$(STATICLIB)
|
@$(INSTALL) $(STATICLIB) $(DESTDIR)$(libdir)/$(STATICLIB)
|
||||||
endif
|
endif
|
||||||
|
@install -d $(DESTDIR)$(datadir)
|
||||||
|
@for file in $(DISTFILES); do \
|
||||||
|
printf " INSTALL $(DESTDIR)$(datadir)/$$file\n"; \
|
||||||
|
install -m 0644 $$file $(DESTDIR)$(datadir)/$$file; \
|
||||||
|
done
|
||||||
|
|
||||||
install: install-exec install-dev
|
install: install-exec install-dev
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
|
-@$(RM) -r $(DESTDIR)$(datadir)
|
||||||
|
-@$(RM) -r $(DESTDIR)$(incdir)/$(LIBNAME)
|
||||||
-@$(RM) $(DESTDIR)$(libdir)/$(SOLIB)
|
-@$(RM) $(DESTDIR)$(libdir)/$(SOLIB)
|
||||||
-@$(RM) $(DESTDIR)$(libdir)/$(SYMLIB)
|
-@$(RM) $(DESTDIR)$(libdir)/$(SYMLIB)
|
||||||
-@$(RM) $(DESTDIR)$(libdir)/$(STATICLIB)
|
-@$(RM) $(DESTDIR)$(libdir)/$(STATICLIB)
|
||||||
-@for file in $(HEADERS); do \
|
|
||||||
$(RM) $(DESTDIR)$(incdir)/$$file; \
|
|
||||||
done
|
|
||||||
|
|
||||||
strip: $(TARGET)
|
strip: $(TARGET)
|
||||||
@printf " STRIP %s\n" $(TARGET)
|
@printf " STRIP %s\n" $(TARGET)
|
||||||
|
|||||||
Reference in new issue
Block a user