makefile setup
This commit is contained in:
parent
40123c6c67
commit
1137a14eda
3 changed files with 29 additions and 0 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
bin/
|
||||
obj/
|
||||
20
Makefile
Normal file
20
Makefile
Normal 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
7
src/main.cpp
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#include <iostream>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout << "Hello World" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue