libs: cleanup clean/install/uninstall

This commit is contained in:
Xiangfu 2012-10-04 08:44:05 +08:00
parent 293e19d2ea
commit 0766aeaefe

View File

@ -65,24 +65,29 @@ libfpga-control.so: $(LIBFPGA_CONTROL_OBJS)
$(MKDEP) $(MKDEP)
clean: clean:
rm -f $(OBJS) $(OBJS:.o=.d) $(DYNAMIC_LIBS) $(DYNAMIC_LIBS:.so=.so.$(LIBS_VERSION_MAJOR)) rm -f $(OBJS) $(OBJS:.o=.d) $(DYNAMIC_LIBS)
rm -f $(DYNAMIC_LIBS:.so=.a)
rm -f $(DYNAMIC_LIBS:.so=.so.$(LIBS_VERSION_MAJOR))
rm -f $(DYNAMIC_LIBS:.so=.so.$(LIBS_VERSION))
install: all install: all
mkdir -p $(DESTDIR)/$(PREFIX)/include/ mkdir -p $(DESTDIR)/$(PREFIX)/include/
mkdir -p $(DESTDIR)/$(PREFIX)/lib/ mkdir -p $(DESTDIR)/$(PREFIX)/lib/
install -m 644 $(DYNAMIC_HEADS) $(DESTDIR)/$(PREFIX)/include/ install -m 644 $(DYNAMIC_HEADS) $(DESTDIR)/$(PREFIX)/include/
for f in $(DYNAMIC_LIBS); do \ for f in $(DYNAMIC_LIBS); do \
chrpath -d $$f.$(LIBS_VERSION_MAJOR) && \ chrpath -d $$f.$(LIBS_VERSION_MAJOR) && \
install -m 644 $$f.$(LIBS_VERSION) $(DESTDIR)/$(PREFIX)/lib/$$f.$(LIBS_VERSION) && \ install -m 644 $$f.$(LIBS_VERSION) $(DESTDIR)/$(PREFIX)/lib/$$f.$(LIBS_VERSION) && \
(cd $(DESTDIR)/$(PREFIX)/lib/ && \ (cd $(DESTDIR)/$(PREFIX)/lib/ && \
ln -sf $$f.$(LIBS_VERSION) $$f.$(LIBS_VERSION_MAJOR) && \ ln -sf $$f.$(LIBS_VERSION) $$f.$(LIBS_VERSION_MAJOR) && \
ln -sf $$f.$(LIBS_VERSION_MAJOR) $$f) \ ln -sf $$f.$(LIBS_VERSION_MAJOR) $$f) \
|| exit 1; done || exit 1; done
for f in $(DYNAMIC_LIBS:.so=.a); do \ for f in $(DYNAMIC_LIBS:.so=.a); do \
install -m 644 $$f $(DESTDIR)/$(PREFIX)/lib/$$f \ install -m 644 $$f $(DESTDIR)/$(PREFIX)/lib/$$f \
|| exit 1; done || exit 1; done
uninstall: uninstall:
for f in $(DYNAMIC_HEADS); do rm -f $(DESTDIR)/$(PREFIX)/include/$$f || exit 1; done for f in $(DYNAMIC_HEADS); do rm -f $(DESTDIR)/$(PREFIX)/include/$$f || exit 1; done
for f in $(DYNAMIC_LIBS) $(DYNAMIC_LIBS:.so=.a); do rm -f $(DESTDIR)/$(PREFIX)/lib/$$f* || exit 1; done for f in $(DYNAMIC_LIBS) $(DYNAMIC_LIBS:.so=.a) \
$(DYNAMIC_LIBS:.so=.so.$(LIBS_VERSION_MAJOR)) \
$(DYNAMIC_LIBS:.so=.so.$(LIBS_VERSION)); do \
rm -f $(DESTDIR)/$(PREFIX)/lib/$$f || exit 1; done