Let the choice of the path to papihighlevel

* Introduce 3 new variables:
  - LOCALDIR: base directory for looking after papihighlevel
  - PAPIHIGHLEVELINCDIR: include directory in $(LOCALDIR)
  - PAPIHIGHLEVELLIBDIR: library directory in $(LOCALDIR)
This commit is contained in:
Thomas Preud'homme 2009-06-10 11:16:11 +02:00 committed by Thomas Preud'homme
parent 3108f6f5f7
commit cc7da2e459
1 changed files with 5 additions and 2 deletions

View File

@ -4,12 +4,15 @@ BINDIR=bin
SRCDIR=src
INCDIR=include
LIBDIR=lib
LOCALDIR=$(HOME)/local
PAPIHIGHLEVELLIBDIR=lib
PAPIHIGHLEVELINCDIR=include
# Compilation flags
# I know -finline-functions and -finline-functions-called-once are enabled by
# -O3 but I did this in case gcc behaviour change one day
CFLAGS=-g -O3 -finline-functions -finline-functions-called-once -Wall -Werror
LDFLAGS=-L$(LIBDIR) -L$(HOME)/local/lib -Wl,-rpath-link,$(HOME)/local/lib -lpthread -lpapihighlevel
LDFLAGS=-L$(LIBDIR) -L$(LOCALDIR)/$(PAPIHIGHLEVELLIBDIR) -Wl,-rpath-link,$(HOME)/local/lib -lpthread -lpapihighlevel
# Executables
CC=gcc
@ -42,7 +45,7 @@ $(LIBDIR)/lib$(BASE_TARGET).a: $(OBJDIR)/$(BASE_TARGET).o $(patsubst %,$(OBJDIR)
# Compile common source files
$(OBJDIR)/$(BASE_TARGET)_%.o: $(SRCDIR)/%.c symlink
if [ ! -d $(OBJDIR) ] ; then mkdir $(OBJDIR) ; fi
$(CC) $(CFLAGS) -I$(INCDIR) -I$(HOME)/local/include -c $< -o $@
$(CC) $(CFLAGS) -I$(INCDIR) -I$(LOCALDIR)/$(PAPIHIGHLEVELINCDIR) -c $< -o $@
endif
# Compile non common source files