From 4327cd4ca27040def87ddfa8f179b46a0cae28e8 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Fri, 14 Jan 2022 01:25:42 -0500 Subject: [PATCH] Use standard variables in the Makefile The standard make variable for C++ compiler flags is CXXFLAGS, and the standard make variable for extra link libraries is LDFLAGS. Use these to make integration with larger build systems simpler. --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 066c3a0..f479a0e 100644 --- a/Makefile +++ b/Makefile @@ -3,21 +3,21 @@ # files PROGRAM = Crc32Test -LIBS = -lrt +LDLIBS = -lrt HEADERS = Crc32.h OBJECTS = Crc32.o Crc32Test.o # flags -FLAGS = -O3 -Wall -Wextra -pedantic -s +CXXFLAGS = -O3 -Wall -Wextra -pedantic -s default: $(PROGRAM) all: default $(PROGRAM): $(OBJECTS) Makefile - $(CXX) $(OBJECTS) $(FLAGS) $(LIBS) -o $(PROGRAM) + $(CXX) $(OBJECTS) $(CXXFLAGS) $(LDLIBS) -o $(PROGRAM) %.o: %.cpp $(HEADERS) Makefile - $(CXX) $(FLAGS) -c $< -o $@ + $(CXX) $(CXXFLAGS) -c $< -o $@ clean: -rm -f $(OBJECTS) $(PROGRAM)