fix makefiles
This commit is contained in:
parent
f2aabbf7c5
commit
1e1166404b
3 changed files with 25 additions and 25 deletions
|
@ -16,8 +16,8 @@ Copy and paste [`c/`](./c/) directory, and you should be good to go!
|
|||
|
||||
- Remember to change executable's name and change std's target in
|
||||
the [`Makefile`](./c/Makefile).
|
||||
- **Run `make` to compile the program.**
|
||||
- **Run `make dev` to compile the program in debug mode.**
|
||||
- **Run `make` to compile the program in release mode.**
|
||||
- **Run `make debug` to compile the program in debug mode.**
|
||||
- **Run `make clean` to clean artifacts.**
|
||||
|
||||
## C++
|
||||
|
@ -26,8 +26,8 @@ Copy and paste [`cpp/`](./cpp/) directory, and you should be good to go!
|
|||
|
||||
- Remember to change executable's name and change std's target in
|
||||
the [`Makefile`](./cpp/Makefile).
|
||||
- **Run `make` to compile the program.**
|
||||
- **Run `make dev` to compile the program in debug mode.**
|
||||
- **Run `make` to compile the program in release mode.**
|
||||
- **Run `make debug` to compile the program in debug mode.**
|
||||
- **Run `make clean` to clean artifacts.**
|
||||
|
||||
## LaTeX
|
||||
|
|
22
c/Makefile
22
c/Makefile
|
@ -2,7 +2,7 @@ CC = gcc
|
|||
RM = rm
|
||||
|
||||
SOURCES = $(wildcard src/*.c)
|
||||
OBJETS = $(patsubst %.c,%.o,$(notdir $(SOURCES)))
|
||||
OBJECTS = $(patsubst %.c,%.o,$(notdir $(SOURCES)))
|
||||
|
||||
CFLAGS = -std=c11 -pedantic
|
||||
LDFLAGS =
|
||||
|
@ -13,19 +13,19 @@ EXE_EXT = out
|
|||
%.o: src/%.c
|
||||
$(CC) -c $< -o $@ $(CFLAGS)
|
||||
|
||||
compilation: $(OBJETS)
|
||||
$(CC) -o $(EXE).$(EXE_EXT) $(OBJETS) $(LDFLAGS)
|
||||
release: CFLAGS += -O3
|
||||
release: compilation
|
||||
|
||||
main: CFLAGS += -O3
|
||||
main: compilation
|
||||
debug: CFLAGS += -Wall -Wextra -Wshadow -Wcast-align -Wstrict-prototypes
|
||||
debug: CFLAGS += -fanalyzer -fsanitize=undefined -g -Og
|
||||
debug: LDFLAGS += -fsanitize=undefined
|
||||
debug: compilation
|
||||
|
||||
dev: CFLAGS += -Wall -Wextra -Wshadow -Wcast-align -Wstrict-prototypes
|
||||
dev: CFLAGS += -fanalyzer -fsanitize=undefined -g -Og
|
||||
dev: LDFLAGS += -fsanitize=undefined
|
||||
dev: compilation
|
||||
compilation: $(OBJECTS)
|
||||
$(CC) -o $(EXE).$(EXE_EXT) $(OBJECTS) $(LDFLAGS)
|
||||
|
||||
all:
|
||||
main
|
||||
release
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJETS) $(EXE).$(EXE_EXT)
|
||||
$(RM) $(OBJECTS) $(EXE).$(EXE_EXT)
|
||||
|
|
20
cpp/Makefile
20
cpp/Makefile
|
@ -2,7 +2,7 @@ CXX = g++
|
|||
RM = rm
|
||||
|
||||
SOURCES = $(wildcard src/*.cpp)
|
||||
OBJETS = $(patsubst %.cpp,%.o,$(notdir $(SOURCES)))
|
||||
OBJECTS = $(patsubst %.cpp,%.o,$(notdir $(SOURCES)))
|
||||
|
||||
CXXFLAGS = --std=c++11
|
||||
|
||||
|
@ -12,18 +12,18 @@ EXE_EXT = out
|
|||
%.o: src/%.cpp
|
||||
$(CXX) -c -o $@ $< $(CXXFLAGS)
|
||||
|
||||
compilation: $(OBJETS)
|
||||
$(CXX) -o $(EXE).$(EXE_EXT) $(OBJETS)
|
||||
release: CXXFLAGS += -O3
|
||||
release: compilation
|
||||
|
||||
main: CXXFLAGS += -O3
|
||||
main: compilation
|
||||
debug: CXXFLAGS += -Wall -Wextra -Wshadow -Wnon-virtual-dtor -pedantic -g
|
||||
debug: CXXFLAGS += -Wold-style-cast -Wsign-conversion
|
||||
debug: compilation
|
||||
|
||||
dev: CXXFLAGS += -Wall -Wextra -Wshadow -Wnon-virtual-dtor -pedantic -g
|
||||
dev: CXXFLAGS += -Wold-style-cast -Wsign-conversion
|
||||
dev: compilation
|
||||
compilation: $(OBJECTS)
|
||||
$(CXX) -o $(EXE).$(EXE_EXT) $(OBJECTS)
|
||||
|
||||
all:
|
||||
main
|
||||
release
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJETS) $(EXE).$(EXE_EXT)
|
||||
$(RM) $(OBJECTS) $(EXE).$(EXE_EXT)
|
||||
|
|
Loading…
Reference in a new issue