From a198a88f97c17439915786ddd638db55ac0d898f Mon Sep 17 00:00:00 2001 From: Krzosa Karol Date: Sun, 12 Jul 2020 21:07:06 +0200 Subject: [PATCH] The unity script doesn't work if you dont have obj folder. I feel like there is no need to run the appliction inside the build script, that adds unneccessary lines/complexity also I changed the name from linux_platform to main cause that's more generic. I didn't know where to add "the simplest possible" thing, so I added it at the end. Tested on PopOS and Windows Subsystem Ubuntu. --- Working-on-GNU-Linux.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Working-on-GNU-Linux.md b/Working-on-GNU-Linux.md index d877702..5225084 100644 --- a/Working-on-GNU-Linux.md +++ b/Working-on-GNU-Linux.md @@ -130,18 +130,21 @@ zypper in raylib-devel ### "Unity build" - the simplest way to build a project. -On linux you can easily build your project (here titled linux_platform.c) without having to mess with make files. It's fast, and easier to reason about. This is called a unity build (no it has nothing to do with the Unity game engine) +On linux you can easily build your project without having to mess with make files. It's fast, and easier to reason about. This is called a unity build (no it has nothing to do with the Unity game engine) -Simple create a build file, and give it executable permissions; +Create a build file, and give it executable permissions: ``` touch build.sh chmod 700 build.sh ``` -The edit build.sh to read: +Then edit build.sh: ``` -set -e # if error, stop the build -cc -g -std=c99 -c -I /opt/raylib/src linux_platform.c -o ./obj/linux_platform.o -cc -o linux_platform obj/linux_platform.o -s -Wall -std=c99 -I/opt/raylib/src -L/opt/raylib/release/libs/linux -lraylib -lGL -lm -lpthread -ldl -lrt -lX11 -./linux_platform +cc main.c -g -std=c99 -c -I /opt/raylib/src -o main.o +cc main.o -s -Wall -std=c99 -I/opt/raylib/src -L/opt/raylib/release/libs/linux -lraylib -lGL -lm -lpthread -ldl -lrt -lX11 +``` + +### The simplest possible build command +``` +cc main.c -lraylib -lGL -lm -lpthread -ldl -lrt -lX11 ``` \ No newline at end of file