Skip to content

Commit

Permalink
Makefile of L17
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Weng authored and Paul Weng committed Jul 9, 2020
1 parent 46bc5a5 commit c78396b
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions L17-Dynamic-Memory/Dynamic-Allocation/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
CXX := g++
CXXFLAGS := -Wall -std=c++11
LDFLAGS := -L/usr/lib -lstdc++ -lm
INCLUDE :=
SRC := $(wildcard *.cpp)
OBJECTS := $(SRC:%.cpp=%.o)
TARGETS := $(SRC:%.cpp=%)

all: $(TARGETS)

%: %.o
$(CXX) $(CXXFLAGS) -o $(APP_DIR)/$(TARGET) $^ $(LDFLAGS)

%.o: %.cpp
$(CXX) $(CXXFLAGS) $(INCLUDE) -c $< -o $@ $(LDFLAGS)

.PHONY: all clean debug release

debug: CXXFLAGS += -DDEBUG -g
debug: all

release: CXXFLAGS += -O2
release: all

clean:
rm -rvf $(TARGETS) $(OBJECTS)

0 comments on commit c78396b

Please sign in to comment.