diff options
-rw-r--r-- | Makefile | 29 | ||||
-rw-r--r-- | README | 8 |
2 files changed, 35 insertions, 2 deletions
@@ -3,12 +3,29 @@ ABI_VERSION := 0 SONAME := libuniso.so.$(ABI_VERSION) -TARGETS := libuniso.a uniso +progs-y += uniso + +INCLUDES := uniso.h +TARGETS := libuniso.a $(progs-y) CFLAGS ?= -g -Wall -Werror CFLAGS += -fPIC CFLAGS += -I. + +prefix ?= /usr +libdir = $(prefix)/lib +bindir = $(prefix)/bin +includedir= $(prefix)/include + +INSTALLDIR := install -d +INSTALL := install + +install-progs-y := $(INSTALLDIR) $(DESTDIR)$(bindir) && \ + $(INSTALL) $(progs-y) $(DESTDIR)$(bindir) +install-libs-y := $(INSTALLDIR) $(DESTDIR)$(libdir) && \ + $(INSTALL) libuniso.a $(DESTDIR)$(libdir) + libuniso.a_OBJS = libuniso.o $(SONAME)_OBJS = $(libuniso.a_OBJS) @@ -21,6 +38,9 @@ all: $(TARGETS) ifneq ($(ENABLE_SHARED_LIB),) shlibs-y += $(SONAME) libuniso.so +install-shlibs-y := $(INSTALLDIR) $(DESTDIR)$(libdir) && \ + $(INSTALL) $(SONAME) $(DESTDIR)$(libdir) && \ + ln -sf $(SONAME) $(DESTDIR)$(libdir)/libuniso.so uniso_LIBS := -luniso else uniso_LIBS := libuniso.a @@ -49,3 +69,10 @@ clean: shared: $(SONAME) +install: $(TARGETS) $(INCLUDES) + $(INSTALLDIR) $(DESTDIR)$(includedir) + $(INSTALL) $(INCLUDES) $(DESTDIR)$(includedir) + $(install-progs-y) + $(install-libs-y) + $(install-shlibs-y) + @@ -6,5 +6,11 @@ To build: To build with shared library: - make ENABLE_SHARED_LIB=yes + echo "ENABLE_SHARED_LIB=yes" > config.mk + make + +To install: + + make install + |