Skip to content

Commit

Permalink
Makefile: Conditional compiler and logging added
Browse files Browse the repository at this point in the history
- Updated CC assignment to be conditional using ifeq
- Added logging for the compiler in use with $(info CC)

The update ensures that the compiler is set only if not explicitly customized,
promoting better portability across different environments. The additional
logging provides clarity about which compiler is in use during builds, helpful
for debugging and verification. 🛠️🖥️
  • Loading branch information
horta committed Nov 7, 2024
1 parent 92858bf commit 9e634d1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
CC ?= gcc
ifeq ($(origin CC),default)
CC := gcc
endif
CFLAGS ?= -std=c11 -Wall -Wextra -O3 -MMD -MP
PREFIX ?= /usr/local
SRC = $(filter-out $(wildcard test_*.c),$(wildcard *.c))
Expand Down Expand Up @@ -62,6 +64,7 @@ CFLAGS += -DATHR_OS_UNIX=$(ATHR_OS_UNIX)
CFLAGS += -DATHR_OS=$(ATHR_OS)

$(info OS = $(OS))
$(info CC = $(CC))
$(info PKG_CONFIG_FOUND = $(PKG_CONFIG_FOUND))
$(info CURSES_FOUND = $(CURSES_FOUND))
$(info CURSES_LIBS = $(CURSES_LIBS))
Expand Down

0 comments on commit 9e634d1

Please sign in to comment.