K
K
Kamikaze10242017-01-31 14:05:29
linux
Kamikaze1024, 2017-01-31 14:05:29

How to add include and lib to existing makefile?

I have a makefile, I want to add a compiled boost to it, which is in the project directory at : readyBoost
/

PROJECT   = fiscat
CC        = arm-linux-gcc
CXX       = arm-linux-g++
STRIP     = arm-linux-strip

ifeq ($(DEBUG), 1)
FLAGS     = -O0 -ggdb3 -DDEBUG
else
FLAGS     = -O2 -DNDEBUG
endif
FLAGS    += -Werror

OFLAGS    = $(FLAGS)
OFLAGS   += -Isrc/appl/include -Isrc/bsp/include 
OFLAGS   += -D__FILENAME__='"$(notdir $<)"'

CFLAGS    = $(OFLAGS) -std=gnu99
CXXFLAGS  = $(OFLAGS) -std=c++11 -Wall


TARGET    = bin/fiscat
CSRC      = $(shell find src -name *.c)
CXXSRC    = $(shell find src -name *.cpp)
COBJ      = $(patsubst %.c,   %.o, $(CSRC))
CXXOBJ    = $(patsubst %.cpp, %.o, $(CXXSRC))
LDLIBS    = -lpthread

all: $(TARGET)

$(TARGET): $(COBJ) $(CXXOBJ)
  rm -rf bin; mkdir bin/
  $(CXX) $(FLAGS) $(COBJ) $(CXXOBJ) $(LDLIBS) [email protected]
ifneq ($(DEBUG), 1)
  $(STRIP) $(TARGET)
endif
  @du -h $(TARGET)
  @file $(TARGET)

%.o: %.c
  $(CC) $(CFLAGS) -c $< -o [email protected]

%.o: %.cpp
  $(CXX) $(CXXFLAGS) -c $< -o [email protected]

clean:
  find src -name *.o -delete
  rm -fr $(TARGET)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
CityCat4, 2017-01-31
@Kamikaze1024

include to add to CFLAGS and CXXFLAGS, or to LDLIBS

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question