labs-edaf30/lab1/Justfile

37 lines
893 B
Makefile
Raw Normal View History

2024-11-12 02:59:00 +01:00
all: a1 a2 a3 a4 cmake buggy
2024-11-11 18:06:14 +01:00
2024-11-12 02:59:00 +01:00
# Build the A1 lab exercise
2024-11-11 18:06:14 +01:00
a1:
g++ -o hello hello.cc
./hello
2024-11-12 02:59:00 +01:00
# Build the A2 lab exercise
2024-11-11 18:06:14 +01:00
a2:
g++ -std=c++11 -o separate_main separate_main.cc separate_fn.cc
2024-11-12 02:59:00 +01:00
# Build the A3 lab exercise
2024-11-11 18:06:14 +01:00
a3:
g++ -std=c++11 -c separate_main.cc
g++ -std=c++11 -c separate_fn.cc
g++ -std=c++11 -o separate_main separate_main.o separate_fn.o
2024-11-12 02:59:00 +01:00
# Build the A4 lab exercise
2024-11-11 18:06:14 +01:00
a4:
2024-11-12 02:59:00 +01:00
@echo "Will fail"
-g++ -std=c++11 -o separate_main separate_main.cc
2024-11-11 18:06:14 +01:00
2024-11-12 02:59:00 +01:00
# Build the A5 lab exercise
2024-11-11 18:06:14 +01:00
a5:
g++ -c -O2 -Wall -Wextra -pedantic-errors -Wold-style-cast -std=c++11 hello.cc
2024-11-12 02:59:00 +01:00
# Build the cmake exercise
cmake:
rm -rf ./cmake-example/build # Start over
cd ./cmake-example && mkdir -p build
cd ./cmake-example/build && cmake ..
cd ./cmake-example/build && make -j$(nproc)
./cmake-example/build/SimpleMain
buggy:
cd ./buggy_programs && make -j4