makefile setup

This commit is contained in:
mykola2312 2024-07-18 17:26:33 +03:00
parent 40123c6c67
commit 1137a14eda
3 changed files with 29 additions and 0 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
bin/
obj/

20
Makefile Normal file
View file

@ -0,0 +1,20 @@
INC_DIR = include
SRC_DIR = src
OBJ_DIR = obj
BIN_DIR = bin
CC = g++
LD = ld
CXXFLAGS = -Wall -I$(INC_DIR)
LDFLAGS =
BLACKJACK_SRC = main.cpp
BLACKJACK_OBJ := $(addprefix $(OBJ_DIR)/,$(patsubst %.cpp,%.o,$(BLACKJACK_SRC)))
BLACKJACK_SRC := $(addprefix $(SRC_DIR)/,$(BLACKJACK_SRC))
BLACKJACK_DEPS =
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp
$(CC) $(CXXFLAGS) -c -o $@ $<
blackjack: $(BLACKJACK_OBJ) $(BLACKJACK_DEPS)
$(CC) $(LDFLAGS) -o $(BIN_DIR)/$@ $(BLACKJACK_OBJ)

7
src/main.cpp Normal file
View file

@ -0,0 +1,7 @@
#include <iostream>
int main()
{
std::cout << "Hello World" << std::endl;
return 0;
}