Skip to content

Commit

Permalink
build: Append $(WARNINGFLAGS) to AM_CFLAGS
Browse files Browse the repository at this point in the history
In src/Makefile.am, remove flex_CFLAGS variable, and append
$(WARNINGFLAGS) to AM_CFLAGS. The use of flex_CFLAGS has forced
Automake to rename flex's object files (.o) to have a 'flex-' prefix.
By preventing the rename, the generated src/Makefile.in can be about
37 kB smaller.

Signed-off-by: Kang-Che Sung <[email protected]>
  • Loading branch information
Explorer09 committed Apr 27, 2024
1 parent b012df9 commit 9d11cd7
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
AM_YFLAGS = -d
AM_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\"
AM_CFLAGS = $(WARNINGFLAGS)
LIBS = @LIBS@
pkgconfigdir = @pkgconfigdir@

Expand Down Expand Up @@ -60,8 +61,6 @@ else
flex_SOURCES += scan.l
endif

flex_CFLAGS = $(AM_CFLAGS) $(WARNINGFLAGS)

COMMON_SOURCES = \
buf.c \
ccl.c \
Expand Down Expand Up @@ -172,17 +171,17 @@ dist-hook: scan.l flex$(EXEEXT)
# not fail.

stage1flex-skeletons.$(OBJEXT): $(SKELINCLUDES)
flex-skeletons.$(OBJEXT): $(SKELINCLUDES)
skeletons.$(OBJEXT): $(SKELINCLUDES)

stage1flex-main.$(OBJEXT): parse.h
flex-main.$(OBJEXT): parse.h
main.$(OBJEXT): parse.h

stage1flex-yylex.$(OBJEXT): parse.h
flex-yylex.$(OBJEXT): parse.h
yylex.$(OBJEXT): parse.h

stage1flex-scan.$(OBJEXT): parse.h
flex-stage1scan.$(OBJEXT): parse.h
flex-scan.$(OBJEXT): parse.h
stage1scan.$(OBJEXT): parse.h
scan.$(OBJEXT): parse.h

# Run GNU indent on sources. Don't run this unless all the sources compile cleanly.
#
Expand Down

0 comments on commit 9d11cd7

Please sign in to comment.