Skip to content

Commit

Permalink
Merge pull request #4 from sanjayankur31/feature/makefile-cflags
Browse files Browse the repository at this point in the history
Feature/makefile cflags
  • Loading branch information
firefly-cpp authored Nov 3, 2020
2 parents 75da8bd + 72e15e8 commit 0022e3d
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
CC=g++
#CFLAGS = -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)"
CFLAGS = -O0 -g3 -Wall
CXX=g++
#CXXFLAGS = -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)"
# If run as DEBUG=1 make, it adds these flags, otherwise it simply uses flags from the environment
ifeq ($(DEBUG), 1)
CXXFLAGS := $(CXXFLAGS) -O0 -g3 -Wall -fmessage-length=0
endif

SRCS = ./sources/Archive.cpp ./sources/Attribute.cpp ./sources/DESolver.cpp ./sources/Evaluate.cpp ./sources/Feature.cpp ./sources/Problem.cpp ./sources/Rule.cpp ./sources/Setup.cpp ./sources/uARMSolver.cpp
SRCS = ./sources/Archive.cpp ./sources/Attribute.cpp ./sources/DESolver.cpp ./sources/Evaluate.cpp ./sources/Feature.cpp ./sources/Problem.cpp ./sources/Rule.cpp ./sources/Setup.cpp ./sources/uARMSolver.cpp

DEPS = ./Archive.d ./Attribute.d ./DESolver.d ./Evaluate.d ./Feature.d ./Problem.d ./Rule.d ./Setup.d ./uARMSolver.d
DEPS = ./Archive.d ./Attribute.d ./DESolver.d ./Evaluate.d ./Feature.d ./Problem.d ./Rule.d ./Setup.d ./uARMSolver.d

OBJS = ./Archive.o ./Attribute.o ./DESolver.o ./Evaluate.o ./Feature.o ./Problem.o ./Rule.o ./Setup.o ./uARMSolver.o
OBJS = ./Archive.o ./Attribute.o ./DESolver.o ./Evaluate.o ./Feature.o ./Problem.o ./Rule.o ./Setup.o ./uARMSolver.o

all: bin/uARMSolver

bin/uARMSolver: $(OBJS)
@echo 'Invoking: GCC C++ Linker'
$(CC) -o $@ $^
$(CXX) $(LDFLAGS) -o $@ $^
@echo 'Finished building: $<'
rm -fr $(OBJS) $(DEPS)

%.o: ./sources/%.cpp
%.o: ./sources/%.cpp
@echo 'Invoking: GCC C++ Compiler'
$(CC) -I./sources -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
$(CXX) -I./sources $(CXXFLAGS) -c -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
@echo 'Finished building: $<'

clean:
Expand Down

0 comments on commit 0022e3d

Please sign in to comment.