Answer the question
In order to leave comments, you need to log in
What is the correct way to compare strings in a Makefile?
Good afternoon! Please help! I am doing a study project. According to the assignment, I have to write a program that works with the minilibx library under MacOS. Unfortunately MacOS is not available... and development has to be done on Linux.
But in order to run a project, you need to be able to run it on MacOS by making it portable to another platform. As a solution for myself, I chose to load the necessary libraries at the build stage using the Makefile, but I ran into a system identification problem. It seems to be nothing complicated to describe if else fi. But as it turned out, not everything is so simple ...
using the code:
<br>
OSname = $(uname)<br>
if [ "${OSname}" = "Linux" ] ; then<br>
MLX_DIR = minilibx-linux<br>
DEFINE = include/init_mlx/linux/define.h<br>
KEYSET = key_map/key_linux/key.c<br>
GETLIB = git clone библиоткеа.git<br>
MAPS = wget maps.zip<br>
MLX = libmlx_Linux.a<br>
MLX_FLAGS = -lXext -lX11 -lm<br>
else<br>
MLX_DIR = minilibx_macos<br>
MLX = libmlx.a<br>
DEFINE = include/init_mlx/macos/define.h<br>
KEYSET = key_map/key_mac/key.c<br>
GETLIB = curl -O библиотека.tgz && tar -xf библиотека.tgz<br>
MAPS = curl -O maps.zip<br>
MLX_FLAGS = -g -L -l mlx -framework OpenGL -framework AppKit -lm<br>
fi<br>
if [ "${OSname}" = "Linux" ] ; then
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question