Skip to content

Commit

Permalink
Merge pull request #6159 from kmk3/build-use-cppflags
Browse files Browse the repository at this point in the history
build: use CPPFLAGS instead of INCLUDE in compile targets
  • Loading branch information
kmk3 authored Jan 20, 2024
2 parents 39fbb6b + 5b1ce32 commit c85aa85
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions config.mk.in
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ MANFLAGS = \
# https://www.gnu.org/software/automake/manual/1.16.5/html_node/User-Variables.html
CC=@CC@
CFLAGS=@CFLAGS@
CPPFLAGS=@CPPFLAGS@
LDFLAGS=@LDFLAGS@

# Project variables
Expand Down
1 change: 1 addition & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -5308,6 +5308,7 @@ cat <<EOF
Compile options:
CC: $CC
CFLAGS: $CFLAGS
CPPFLAGS: $CPPFLAGS
LDFLAGS: $LDFLAGS
EXTRA_CFLAGS: $EXTRA_CFLAGS
EXTRA_LDFLAGS: $EXTRA_LDFLAGS
Expand Down
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ cat <<EOF
Compile options:
CC: $CC
CFLAGS: $CFLAGS
CPPFLAGS: $CPPFLAGS
LDFLAGS: $LDFLAGS
EXTRA_CFLAGS: $EXTRA_CFLAGS
EXTRA_LDFLAGS: $EXTRA_LDFLAGS
Expand Down
2 changes: 1 addition & 1 deletion src/prog.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ OBJS := $(SRCS:.c=.o) $(EXTRA_OBJS)
all: $(TARGET)

%.o : %.c $(HDRS) $(ROOT)/config.mk
$(CC) $(PROG_CFLAGS) $(CFLAGS) $(INCLUDE) -c $< -o $@
$(CC) $(PROG_CFLAGS) $(CFLAGS) $(CPPFLAGS) -c $< -o $@

$(PROG): $(OBJS) $(ROOT)/config.mk
$(CC) $(PROG_LDFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
Expand Down
2 changes: 1 addition & 1 deletion src/so.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ OBJS := $(SRCS:.c=.o) $(EXTRA_OBJS)
all: $(TARGET)

%.o : %.c $(HDRS) $(ROOT)/config.mk
$(CC) $(SO_CFLAGS) $(CFLAGS) $(INCLUDE) -c $< -o $@
$(CC) $(SO_CFLAGS) $(CFLAGS) $(CPPFLAGS) -c $< -o $@

$(SO): $(OBJS) $(ROOT)/config.mk
$(CC) $(SO_LDFLAGS) -shared $(LDFLAGS) -o $@ $(OBJS) -ldl
Expand Down

0 comments on commit c85aa85

Please sign in to comment.