--- Makefile.orig 2015-06-25 22:20:28 UTC +++ Makefile @@ -18,8 +18,8 @@ DEMOS := $(wildcard demos/*.c) DEMOS_OBJ := $(addprefix obj/,$(notdir $(DEMOS:.c=.o))) DEMOS_EXE := $(DEMOS:.c=) -CFLAGS = -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -LFLAGS = -shared -g -ggdb +CFLAGS += -I ./include -std=gnu99 -Wall -Werror -Wno-unused +LFLAGS = ${LDFLAGS} -shared PLATFORM := $(shell uname) COMPILER := $(shell $(CC) -v 2>&1 ) @@ -42,8 +42,8 @@ else CFLAGS += -fPIC - INSTALL_LIB = mkdir -p ${LIBDIR} && cp -f ${STATIC} ${LIBDIR}/$(STATIC) - INSTALL_INC = mkdir -p ${INCDIR} && cp -r include/* ${INCDIR} + INSTALL_LIB = mkdir -p ${DESTDIR}${LIBDIR} && cp -f ${STATIC} ${DESTDIR}${LIBDIR}/$(STATIC) + INSTALL_INC = mkdir -p ${DESTDIR}${INCDIR} && cp -r include/* ${DESTDIR}${INCDIR} endif ifeq ($(findstring clang,$(COMPILER)),clang)