Add ext "out" to output binaries for c and cpp projects
This commit is contained in:
parent
f8b209af75
commit
c8880c3dbb
4 changed files with 8 additions and 6 deletions
2
c/.gitignore
vendored
2
c/.gitignore
vendored
|
@ -1,2 +1,2 @@
|
||||||
*.o
|
*.o
|
||||||
example
|
*.out
|
||||||
|
|
|
@ -7,6 +7,7 @@ SOURCES = $(wildcard src/*.c)
|
||||||
OBJETS = $(patsubst %.c,%.c.o,$(notdir $(SOURCES)))
|
OBJETS = $(patsubst %.c,%.c.o,$(notdir $(SOURCES)))
|
||||||
|
|
||||||
EXE = example
|
EXE = example
|
||||||
|
EXE_EXT = out
|
||||||
|
|
||||||
%.c.o: src/%.c
|
%.c.o: src/%.c
|
||||||
$(CC) -c $< -o $@ $(CFLAGS) $(DEVFLAGS)
|
$(CC) -c $< -o $@ $(CFLAGS) $(DEVFLAGS)
|
||||||
|
@ -20,10 +21,10 @@ dev: LDFLAGS += -fsanitize=undefined
|
||||||
dev: compilation
|
dev: compilation
|
||||||
|
|
||||||
compilation: $(OBJETS)
|
compilation: $(OBJETS)
|
||||||
$(CC) -o $(EXE) $(OBJETS) $(LDFLAGS)
|
$(CC) -o $(EXE).$(EXE_EXT) $(OBJETS) $(LDFLAGS)
|
||||||
|
|
||||||
all:
|
all:
|
||||||
main
|
main
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) $(OBJETS) $(EXE)
|
$(RM) $(OBJETS) $(EXE).$(EXE_EXT)
|
||||||
|
|
2
cpp/.gitignore
vendored
2
cpp/.gitignore
vendored
|
@ -1,2 +1,2 @@
|
||||||
*.o
|
*.o
|
||||||
example
|
*.out
|
||||||
|
|
|
@ -6,6 +6,7 @@ SOURCES = $(wildcard src/*.cpp)
|
||||||
OBJETS = $(patsubst %.cpp,%.cpp.o,$(notdir $(SOURCES)))
|
OBJETS = $(patsubst %.cpp,%.cpp.o,$(notdir $(SOURCES)))
|
||||||
|
|
||||||
EXE = example
|
EXE = example
|
||||||
|
EXE_EXT = out
|
||||||
|
|
||||||
%.cpp.o: src/%.cpp
|
%.cpp.o: src/%.cpp
|
||||||
$(CXX) -c -o $@ $< $(CXXFLAGS) $(DEVFLAGS)
|
$(CXX) -c -o $@ $< $(CXXFLAGS) $(DEVFLAGS)
|
||||||
|
@ -17,10 +18,10 @@ dev: CXXFLAGS += -Wall -Wextra -Wshadow -Wnon-virtual-dtor -pedantic -g -Wold-st
|
||||||
dev: compilation
|
dev: compilation
|
||||||
|
|
||||||
compilation: $(OBJETS)
|
compilation: $(OBJETS)
|
||||||
$(CXX) -o $(EXE) $(OBJETS)
|
$(CXX) -o $(EXE).$(EXE_EXT) $(OBJETS)
|
||||||
|
|
||||||
all:
|
all:
|
||||||
main
|
main
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) $(OBJETS) $(EXE)
|
$(RM) $(OBJETS) $(EXE).$(EXE_EXT)
|
||||||
|
|
Loading…
Reference in a new issue