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
|
||||
example
|
||||
*.out
|
||||
|
|
|
@ -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
2
cpp/.gitignore
vendored
|
@ -1,2 +1,2 @@
|
|||
*.o
|
||||
example
|
||||
*.out
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue