Skip to content

Commit

Permalink
Enhance Makefile
Browse files Browse the repository at this point in the history
LDFLAGS are not for libs but for linker flags
Allow CXX and CXXFLAGS from env
Use CXXFLAGS for c++ code

Signed-off-by: Justin Lecher <[email protected]>
  • Loading branch information
jlec committed Aug 30, 2012
1 parent fb9decc commit 0153be1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ LIBS = -Llib \
-lpthread \
-lusb-1.0

CXX = g++
CFLAGS = -Wall -O2 -g $(INCLUDES)
LDFLAGS = $(LIBS)
CXX ?= g++
CXXFLAGS ?= -Wall -O2 -g
CPPFLAGS += $(INCLUDES)

all: $(OUT)

Expand All @@ -26,7 +26,7 @@ $(OUT): lib/libnvstusb.a $(OBJ)
@echo "============================================================"
@echo " Linking..."
@echo "============================================================"
$(CXX) -o $@ $(OBJ) $(LDFLAGS)
$(CXX) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
@echo ""
@echo "============================================================"
@echo " Done."
Expand All @@ -43,7 +43,7 @@ lib/libnvstusb.a:
@echo "============================================================"

.cpp.o:
$(CXX) -c $(CFLAGS) -o $@ $<
$(CXX) $(CPPFLAGS) -c $(CXXFLAGS) -o $@ $<

clean:
make -C lib clean
Expand Down

0 comments on commit 0153be1

Please sign in to comment.