Skip to content

Commit

Permalink
build: Use make's linker flags for libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
itislu committed Aug 18, 2024
1 parent d9d490b commit 3d964a2
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# By: ldulling <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/12/23 03:22:46 by ldulling #+# #+# #
# Updated: 2024/07/02 17:06:11 by ldulling ### ########.fr #
# Updated: 2024/07/31 02:14:58 by ldulling ### ########.fr #
# #
# **************************************************************************** #

Expand Down Expand Up @@ -49,9 +49,8 @@ CFLAGS_SAN := -fsanitize=address,undefined,bounds,float-divide-by-zero
CFLAGS_OPT := -O3
CFLAGS ?= $(CFLAGS_STD) $(CFLAGS_DBG)
INCFLAGS := $(addprefix -I,$(INC_DIR) $(LIB_INCLUDES))
LIBFLAGS := $(addprefix -L,$(LIBRARIES)) \
$(addprefix -l,$(patsubst lib%,%,$(notdir \
$(LIBRARIES) $(LIBRARIES_EXT))))
LDFLAGS := $(addprefix -L,$(LIBRARIES))
LDLIBS := $(addprefix -l,$(patsubst lib%,%,$(notdir $(LIBRARIES) $(LIBRARIES_EXT))))
MAKEFLAGS := -j -s


Expand Down Expand Up @@ -272,7 +271,7 @@ waitforlib : lib
# Executable linking

$(NAME) : $(LIBRARIES) $(OBJ)
$(CC) $(CFLAGS) $(INCFLAGS) $(OBJ) $(LIBFLAGS) -o $(NAME)
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJ) $(LDLIBS) -o $(NAME)


# Source file compiling
Expand Down

0 comments on commit 3d964a2

Please sign in to comment.