Add ext "out" to output binaries for c and cpp projects

This commit is contained in:
Mylloon 2023-10-10 13:15:09 +02:00
parent f8b209af75
commit c8880c3dbb
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
4 changed files with 8 additions and 6 deletions

2
c/.gitignore vendored
View file

@ -1,2 +1,2 @@
*.o
example
*.out

View file

@ -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)

2
cpp/.gitignore vendored
View file

@ -1,2 +1,2 @@
*.o
example
*.out

View file

@ -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)