mirror of
https://github.com/troglobit/libuev.git
synced 2026-11-12 16:51:07 +00:00
Add support for building static-only libuev.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
ce3930f0cf
commit
63697e9eda
1 file changed
+13
-4
@@ -33,7 +33,11 @@ ARCHIVE = $(PKG).tar.xz
|
|||||||
CC ?= $(CROSS)gcc
|
CC ?= $(CROSS)gcc
|
||||||
AR ?= $(CROSS)ar
|
AR ?= $(CROSS)ar
|
||||||
STRIP ?= $(CROSS)strip
|
STRIP ?= $(CROSS)strip
|
||||||
CFLAGS += -fPIC -Os
|
|
||||||
|
ifneq ($(STATIC), 1)
|
||||||
|
CFLAGS += -fPIC
|
||||||
|
endif
|
||||||
|
CFLAGS += -Os
|
||||||
CPPFLAGS += -W -Wall -Werror
|
CPPFLAGS += -W -Wall -Werror
|
||||||
ARFLAGS = crus
|
ARFLAGS = crus
|
||||||
JUNK = *~ *.bak *.map .*.d DEADJOE *.gdb *.elf core core.* *.html
|
JUNK = *~ *.bak *.map .*.d DEADJOE *.gdb *.elf core core.* *.html
|
||||||
@@ -56,7 +60,11 @@ VER = 1
|
|||||||
SOLIB = $(LIBNAME).so.$(VER)
|
SOLIB = $(LIBNAME).so.$(VER)
|
||||||
SYMLIB = $(LIBNAME).so
|
SYMLIB = $(LIBNAME).so
|
||||||
STATICLIB = $(LIBNAME).a
|
STATICLIB = $(LIBNAME).a
|
||||||
|
ifeq ($(STATIC), 1)
|
||||||
|
TARGET = $(STATICLIB)
|
||||||
|
else
|
||||||
TARGET = $(STATICLIB) $(SOLIB)
|
TARGET = $(STATICLIB) $(SOLIB)
|
||||||
|
endif
|
||||||
|
|
||||||
export STATICLIB JUNK ROOTDIR CFLAGS CPPFLAGS
|
export STATICLIB JUNK ROOTDIR CFLAGS CPPFLAGS
|
||||||
|
|
||||||
@@ -77,9 +85,10 @@ $(STATICLIB): Makefile $(OBJS)
|
|||||||
|
|
||||||
install: strip
|
install: strip
|
||||||
@install -d $(DESTDIR)$(libdir)
|
@install -d $(DESTDIR)$(libdir)
|
||||||
@install $(SOLIB) $(DESTDIR)$(prefix)/lib/$(SOLIB)
|
@printf " INSTALL $(DESTDIR)$(libdir)/$(TARGET)\n"
|
||||||
@install $(STATICLIB) $(DESTDIR)$(prefix)/lib/$(STATICLIB)
|
@install $(SOLIB) $(DESTDIR)$(libdir)/$(SOLIB)
|
||||||
@ln -sf $(SOLIB) $(DESTDIR)$(prefix)/lib/$(SYMLIB)
|
@install $(STATICLIB) $(DESTDIR)$(libdir)/$(STATICLIB)
|
||||||
|
@ln -sf $(SOLIB) $(DESTDIR)$(libdir)/$(SYMLIB)
|
||||||
@install -d $(DESTDIR)$(incdir)
|
@install -d $(DESTDIR)$(incdir)
|
||||||
@install -m 0644 $(HEADER) $(DESTDIR)$(incdir)/$(HEADER)
|
@install -m 0644 $(HEADER) $(DESTDIR)$(incdir)/$(HEADER)
|
||||||
@install -d $(DESTDIR)$(datadir)
|
@install -d $(DESTDIR)$(datadir)
|
||||||
|
|||||||
Reference in new issue
Block a user