add basic project structure
This commit is contained in:
parent
2dabc9d659
commit
b72e86d410
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
.cache
|
||||
.vscode
|
||||
compile_commands.json
|
||||
core*
|
||||
build
|
||||
log
|
42
Makefile
Normal file
42
Makefile
Normal file
@ -0,0 +1,42 @@
|
||||
# Compiler and flags
|
||||
CPPC = g++
|
||||
CPPC_FLAGS = -std=c++23 -s -O3 -Wall -Wextra -Wno-write-strings
|
||||
DEBUG_FLAGS = -ggdb -std=c++23 -Wall -Wextra -Wno-write-strings
|
||||
|
||||
|
||||
SRC_PATH := src
|
||||
OBJ_PATH := build/obj
|
||||
BIN_PATH := build/bin
|
||||
|
||||
|
||||
SRC_FILES := $(shell find $(SRC_PATH) -name '*.cpp')
|
||||
OBJ_FILES := $(patsubst $(SRC_PATH)/%.cpp,$(OBJ_PATH)/%.o,$(SRC_FILES))
|
||||
|
||||
|
||||
all: make-build-dir $(BIN_PATH)/ParaDocs
|
||||
|
||||
|
||||
debug: CPPC_FLAGS = $(DEBUG_FLAGS)
|
||||
debug: make-build-dir $(BIN_PATH)/ParaDocs
|
||||
|
||||
|
||||
make-build-dir:
|
||||
mkdir -p $(OBJ_PATH)
|
||||
mkdir -p $(BIN_PATH)
|
||||
|
||||
|
||||
$(BIN_PATH)/ParaDocs: $(OBJ_FILES)
|
||||
$(CPPC) $(CPPC_FLAGS) $^ -o $@
|
||||
|
||||
|
||||
$(OBJ_PATH)/%.o: $(SRC_PATH)/%.cpp
|
||||
$(CPPC) $(CPPC_FLAGS) -c $< -o $@
|
||||
|
||||
|
||||
install:
|
||||
@install -vpm 755 -o root -g root $(BIN_PATH)/ParaDocs /usr/bin/
|
||||
|
||||
clean:
|
||||
rm -fr build
|
||||
|
||||
.PHONY: all clean install debug
|
7
src/main.cpp
Normal file
7
src/main.cpp
Normal file
@ -0,0 +1,7 @@
|
||||
#include <iostream>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
for(int i= 0;i < 10; i++){
|
||||
std::cout << "trestní oznámení\n";
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user