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:
parent
3108f6f5f7
commit
cc7da2e459
|
@ -4,12 +4,15 @@ BINDIR=bin
|
||||||
SRCDIR=src
|
SRCDIR=src
|
||||||
INCDIR=include
|
INCDIR=include
|
||||||
LIBDIR=lib
|
LIBDIR=lib
|
||||||
|
LOCALDIR=$(HOME)/local
|
||||||
|
PAPIHIGHLEVELLIBDIR=lib
|
||||||
|
PAPIHIGHLEVELINCDIR=include
|
||||||
|
|
||||||
# Compilation flags
|
# Compilation flags
|
||||||
# I know -finline-functions and -finline-functions-called-once are enabled by
|
# I know -finline-functions and -finline-functions-called-once are enabled by
|
||||||
# -O3 but I did this in case gcc behaviour change one day
|
# -O3 but I did this in case gcc behaviour change one day
|
||||||
CFLAGS=-g -O3 -finline-functions -finline-functions-called-once -Wall -Werror
|
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
|
# Executables
|
||||||
CC=gcc
|
CC=gcc
|
||||||
|
@ -42,7 +45,7 @@ $(LIBDIR)/lib$(BASE_TARGET).a: $(OBJDIR)/$(BASE_TARGET).o $(patsubst %,$(OBJDIR)
|
||||||
# Compile common source files
|
# Compile common source files
|
||||||
$(OBJDIR)/$(BASE_TARGET)_%.o: $(SRCDIR)/%.c symlink
|
$(OBJDIR)/$(BASE_TARGET)_%.o: $(SRCDIR)/%.c symlink
|
||||||
if [ ! -d $(OBJDIR) ] ; then mkdir $(OBJDIR) ; fi
|
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
|
endif
|
||||||
|
|
||||||
# Compile non common source files
|
# Compile non common source files
|
||||||
|
|
Loading…
Reference in New Issue