Use environment variables for CC and PREFIX

Pull request #3 can break the compilation process. In my case, cc
points to gcc which cannot handle the `-G_DISABLE_DEPRECATED` and the
`-GDK_PIXBUF_DISABLE_DEPRECATED` command-line options whereas clang
works like a charm.

This commit allows the user to use whichever compiler they want
through environment variables such as:
    CC=clang make all

It also allows the user to define their preferred prefix with
environment variables:
    PREFIX=$HOME/.local/bin make install
This commit is contained in:
Lucien Cartier-Tilet 2022-05-14 20:06:17 +02:00
parent e66bc2d5ab
commit d69bb7d05a
No known key found for this signature in database
GPG Key ID: BD7789E705CB8DCA

View File

@ -1,4 +1,5 @@
CC = cc # -*- indent-tabs-mode: t -*-
CC ?= cc
CFLAGS = `pkg-config --cflags gtk4 webkit2gtk-5.0 x11` CFLAGS = `pkg-config --cflags gtk4 webkit2gtk-5.0 x11`
LIBS = `pkg-config --libs gtk4 webkit2gtk-5.0 x11` LIBS = `pkg-config --libs gtk4 webkit2gtk-5.0 x11`
OPTIONS = -Dgtk_doc=false -Dintrospection=false \ OPTIONS = -Dgtk_doc=false -Dintrospection=false \
@ -16,7 +17,7 @@ OPTIONS = -Dgtk_doc=false -Dintrospection=false \
-Db_coverage=false \ -Db_coverage=false \
-Ddebug=false -Ddebug=false
PREFIX=/usr/local PREFIX ?= /usr/local
all: all:
$(CC) -fPIC -O3 -o rose *.c $(CFLAGS) $(LIBS) $(OPTIONS) $(CC) -fPIC -O3 -o rose *.c $(CFLAGS) $(LIBS) $(OPTIONS)