From c8880c3dbbf870168f218ae5d466bcf71c792cb9 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 10 Oct 2023 13:15:09 +0200 Subject: [PATCH] Add ext "out" to output binaries for c and cpp projects --- c/.gitignore | 2 +- c/Makefile | 5 +++-- cpp/.gitignore | 2 +- cpp/Makefile | 5 +++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/c/.gitignore b/c/.gitignore index 25064ae..17fbe89 100644 --- a/c/.gitignore +++ b/c/.gitignore @@ -1,2 +1,2 @@ *.o -example +*.out diff --git a/c/Makefile b/c/Makefile index 9e3c362..acaf3c5 100644 --- a/c/Makefile +++ b/c/Makefile @@ -7,6 +7,7 @@ SOURCES = $(wildcard src/*.c) OBJETS = $(patsubst %.c,%.c.o,$(notdir $(SOURCES))) EXE = example +EXE_EXT = out %.c.o: src/%.c $(CC) -c $< -o $@ $(CFLAGS) $(DEVFLAGS) @@ -20,10 +21,10 @@ dev: LDFLAGS += -fsanitize=undefined dev: compilation compilation: $(OBJETS) - $(CC) -o $(EXE) $(OBJETS) $(LDFLAGS) + $(CC) -o $(EXE).$(EXE_EXT) $(OBJETS) $(LDFLAGS) all: main clean: - $(RM) $(OBJETS) $(EXE) + $(RM) $(OBJETS) $(EXE).$(EXE_EXT) diff --git a/cpp/.gitignore b/cpp/.gitignore index 25064ae..17fbe89 100644 --- a/cpp/.gitignore +++ b/cpp/.gitignore @@ -1,2 +1,2 @@ *.o -example +*.out diff --git a/cpp/Makefile b/cpp/Makefile index aaf3e81..7d5a5df 100644 --- a/cpp/Makefile +++ b/cpp/Makefile @@ -6,6 +6,7 @@ SOURCES = $(wildcard src/*.cpp) OBJETS = $(patsubst %.cpp,%.cpp.o,$(notdir $(SOURCES))) EXE = example +EXE_EXT = out %.cpp.o: src/%.cpp $(CXX) -c -o $@ $< $(CXXFLAGS) $(DEVFLAGS) @@ -17,10 +18,10 @@ dev: CXXFLAGS += -Wall -Wextra -Wshadow -Wnon-virtual-dtor -pedantic -g -Wold-st dev: compilation compilation: $(OBJETS) - $(CXX) -o $(EXE) $(OBJETS) + $(CXX) -o $(EXE).$(EXE_EXT) $(OBJETS) all: main clean: - $(RM) $(OBJETS) $(EXE) + $(RM) $(OBJETS) $(EXE).$(EXE_EXT)