🎉 Hello World!
Makefile for repository, .gitignore for the structure, hello_world.cpp program for test.
commit
324d5ae908
@ -0,0 +1,5 @@
|
||||
# Build output
|
||||
out/
|
||||
|
||||
# Class slides
|
||||
resources/
|
||||
@ -0,0 +1,24 @@
|
||||
# Pfad zum Makefile selbst bestimmen
|
||||
MAKEFILE_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
|
||||
|
||||
CXX := clang++
|
||||
CXXFLAGS := -Wall -Wextra -Wpedantic -O2 -std=c++23
|
||||
|
||||
SRC_DIR := $(MAKEFILE_DIR)/src
|
||||
OUT_DIR := $(MAKEFILE_DIR)/out
|
||||
|
||||
SOURCES := $(wildcard $(SRC_DIR)/*.cpp)
|
||||
TARGETS := $(patsubst $(SRC_DIR)/%.cpp,$(OUT_DIR)/%,$(SOURCES))
|
||||
|
||||
all: $(OUT_DIR) $(TARGETS)
|
||||
|
||||
$(OUT_DIR):
|
||||
mkdir -p $(OUT_DIR)
|
||||
|
||||
$(OUT_DIR)/%: $(SRC_DIR)/%.cpp
|
||||
$(CXX) $(CXXFLAGS) $< -o $@
|
||||
|
||||
clean:
|
||||
rm -rf $(OUT_DIR)
|
||||
|
||||
.PHONY: all clean
|
||||
@ -0,0 +1,4 @@
|
||||
# Algorithmisches Beweisen - LAB
|
||||
Dateien in diesem Repository:
|
||||
- `Makefile`: Hiermit lässt sich jedes Programm in src kompilieren.
|
||||
- `src/hello_world.cpp`: Hello World test Programm.
|
||||
@ -0,0 +1,8 @@
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
cout << "Hello World!" << endl;
|
||||
return 0;
|
||||
}
|
||||
Loading…
Reference in New Issue