From b6e9d5ae86418b0dae400087bd1a26da82a0d893 Mon Sep 17 00:00:00 2001 From: Zack Buhman Date: Wed, 23 Aug 2023 20:04:30 -0700 Subject: [PATCH] Makefile: add static build --- .gitignore | 1 + Makefile | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 215d0b0..8664051 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ main +scu-dsp-asm *.o *.gch *.d diff --git a/Makefile b/Makefile index bbba52d..873befa 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,9 @@ -CXXFLAGS = -Og -g -Wall -Wextra -Werror -Wfatal-errors -Wpedantic -Wno-c99-designator -std=c++20 +STATIC = -static -static-libgcc -static-libstdc++ +CXXFLAGS = -Og -g -Wall -Wextra -Werror -Wfatal-errors -Wno-c99-designator -std=c++20 LDFLAGS = TARGET = -CXX = $(TARGET)clang++ +CXX = $(TARGET)g++ SRC = main.cpp SRC += lexer.cpp @@ -14,15 +15,15 @@ SRC += stmt_string.cpp OBJ = $(patsubst %.cpp,%.o,$(SRC)) DEP = $(patsubst %.cpp,%.d,$(SRC)) -all: main +all: scu-dsp-asm -include $(DEP) %.o: %.cpp $(CXX) $(CXXFLAGS) -MMD -MF $(basename $<).d -c $< -o $@ -main: $(OBJ) - $(CXX) $(LDFLAGS) $^ -o $@ +scu-dsp-asm: $(OBJ) + $(CXX) $(STATIC) $(LDFLAGS) $^ -o $@ clean: rm -f *.o *.d *.gch main