Skip to content

Commit

Permalink
Fix CXX and CXXFLAGS are for g++ and this is a C project kbranigan#18
Browse files Browse the repository at this point in the history
CXX = gcc is not a good idea because:
1/ We cannot override options like: make CC=clang-13 CFLAGS="-O2 -s
-Wall -fPIC" -j8
2/ CXX is for g++ and overriding will fail compiling the project.
3/ CC is by default equals to cc (gcc)
  • Loading branch information
Lecrapouille committed Nov 9, 2022
1 parent 4fff135 commit ff2b18f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ LIBDIR = lib
INCDIR = src
OBJDIR = obj

CXX = gcc
CXXFLAGS = -O2 -s -Wall
CFLAGS ?= -O2 -s -Wall
DELETER = rm -f
COPIER = cp

Expand All @@ -39,7 +38,7 @@ $(BIN): $(OBJ)

$(OBJDIR)/%.o: $(SRCDIR)/%.c
mkdir -p $(OBJDIR)
$(CXX) $(CXXFLAGS) -o $@ -c $<
$(CC) $(CFLAGS) -o $@ -c $<


clean:
Expand Down

0 comments on commit ff2b18f

Please sign in to comment.