-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add simplest possible c++ setup
- Loading branch information
Showing
4 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
CXX = g++ | ||
CXXFLAGS = -g -Wall | ||
TARGET = main.out | ||
SRC = $(wildcard *.cpp) | ||
OBJ = $(SRC:.cpp=.o) | ||
|
||
all: $(TARGET) | ||
|
||
# Build target | ||
$(TARGET): $(OBJ) | ||
$(CXX) $(CXXFLAGS) $(OBJ) -o $(TARGET) | ||
|
||
%.o: %.cpp | ||
$(CXX) $(CXXFLAGS) -c $< -o $@ | ||
|
||
# Clean target | ||
clean: | ||
rm -f $(TARGET) $(OBJ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# C++ | ||
|
||
Various sample C++ applications showing C++ lang structure, concepts, sample libraries usage build, dependency management etc. | ||
|
||
## Prerequisites | ||
|
||
C++ compiler | ||
|
||
```bash | ||
# for Ubuntu | ||
sudo apt -y install build-essential | ||
``` | ||
|
||
## Building from code | ||
|
||
```bash | ||
# to build application | ||
make | ||
|
||
# to remove intermediate build files and compiled application | ||
make clean | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include <iostream> | ||
using namespace std; | ||
|
||
int main() { | ||
cout << "Hello, World!" << endl; | ||
return 0; | ||
} |