-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: abaurens <[email protected]> Reviewed-on: https://git.baurens.net/arthur/select/pulls/3
- Loading branch information
Showing
5 changed files
with
31 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
# By: abaurens <[email protected]> +#+ +:+ +#+ # | ||
# +#+#+#+#+#+ +#+ # | ||
# Created: 2024/12/03 03:51:56 by abaurens #+# #+# # | ||
# Updated: 2024/12/04 13:57:47 by abaurens ### ########.fr # | ||
# Updated: 2024/12/05 22:00:12 by abaurens ### ########.fr # | ||
# # | ||
# **************************************************************************** # | ||
|
||
|
@@ -15,10 +15,11 @@ RM := rm -rf | |
CP := cp -rf | ||
LINKER := gcc -o | ||
|
||
CVERSION := c99 | ||
|
||
NAME := select | ||
|
||
CVERSION := ansi | ||
OPTI_LVL := 3 | ||
|
||
SRCD := src | ||
OBJD := obj | ||
|
||
|
@@ -33,36 +34,43 @@ OBJS := $(addprefix $(OBJD)/,$(SRCS:.c=.o)) | |
SRCS := $(addprefix $(SRCD)/,$(SRCS)) | ||
INCDEPS := $(INCDEPS) $(OBJS:.o=.d) | ||
|
||
INCLUDES := ./include | ||
INCLUDES := $(addprefix -I,$(INCLUDES)) | ||
|
||
|
||
DEFINES := _GNU_SOURCE \ | ||
VERSION="\"$(shell git describe --tag)\n\"" | ||
DEFINES := $(addprefix -D,$(DEFINES)) | ||
|
||
OPTI_LVL := 3 | ||
|
||
CFLAGS := -std=$(CVERSION) -MMD -MP -I./include -W -Wall -Wextra -pedantic $(DEFINES) | ||
CFLAGS := -MMD -MP -W -Wall -Wextra -pedantic $(INCLUDES) $(DEFINES) | ||
LDFLAGS := -lncurses -ltinfo | ||
|
||
|
||
ifeq ($(strip $(CVERSION)), ansi) | ||
CFLAGS := -ansi $(CFLAGS) | ||
else | ||
CFLAGS := -std=$(CVERSION) $(CFLAGS) | ||
endif | ||
|
||
AIO := false | ||
ifeq ($(strip $(AIO)), true) | ||
# Optimize for binary size and force static linkage | ||
OPTI_LVL := s | ||
LDFLAGS := -static $(LDFLAGS) | ||
OPTI_LVL := s | ||
LDFLAGS := -static $(LDFLAGS) | ||
endif | ||
|
||
DEBUG := false | ||
ifeq ($(strip $(DEBUG)), true) | ||
# Optimize for debugging and enable debug symbols | ||
OPTI_LVL := g | ||
CFLAGS := $(CFLAGS) -g | ||
OPTI_LVL := g | ||
CFLAGS := $(CFLAGS) -g | ||
else | ||
# Optimize for speed and enable no tollerance mode on warnings | ||
CFLAGS := $(CFLAGS) -Werror | ||
CFLAGS := $(CFLAGS) -Werror | ||
endif | ||
|
||
CFLAGS := -O$(OPTI_LVL) $(CFLAGS) | ||
|
||
all: $(NAME) | ||
|
||
$(NAME): $(OBJS) | ||
$(LINKER) $(NAME) $(OBJS) $(LDFLAGS) | ||
|
||
|
@@ -79,6 +87,6 @@ fclean: | |
$(RM) $(OBJD) | ||
$(RM) $(NAME) | ||
|
||
re: fclean all | ||
re: fclean $(NAME) | ||
|
||
.PHONY: all clean fclean re debug | ||
.PHONY: clean fclean re debug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters