Peter Moulder fixed CFLAGS

This commit is contained in:
albert 2003-09-01 00:18:58 +00:00
parent 360e6533c9
commit 28d744ee6a
5 changed files with 33 additions and 19 deletions

View File

@ -63,13 +63,29 @@ TARFILES := AUTHORS BUGS NEWS README TODO COPYING COPYING.LIB \
CURSES := -I/usr/include/ncurses -lncurses
LDFLAGS := -Wl,-warn-common
# Preprocessor flags.
PKG_CPPFLAGS := -D_GNU_SOURCE -I proc
CPPFLAGS :=
ALL_CPPFLAGS := $(PKG_CPPFLAGS) $(CPPFLAGS)
CFLAGS := -D_GNU_SOURCE -O2 -g3 -fno-common -ffast-math -I proc \
# Left out -Wconversion due to noise in glibc headers.
# Left out a number of things that older compilers lack:
# -Wpadded -Wunreachable-code -Wdisabled-optimization
#
# Since none of the PKG_CFLAGS things are truly required
# to compile procps, they might best be moved to CFLAGS.
# On the other hand, they aren't normal -O -g things either.
#
PKG_CFLAGS := -fno-common -ffast-math \
-W -Wall -Wshadow -Wcast-align -Wredundant-decls \
-Wbad-function-cast -Wcast-qual -Wwrite-strings -Waggregate-return \
# -Wpadded -Wunreachable-code -Wdisabled-optimization \
-Wstrict-prototypes -Wmissing-prototypes # -Wconversion
-Wstrict-prototypes -Wmissing-prototypes
CFLAGS := -O2 -g3
ALL_CFLAGS := $(PKG_CFLAGS) $(CFLAGS)
PKG_LDFLAGS := -Wl,-warn-common
LDFLAGS :=
ALL_LDFLAGS := $(PKG_LDFLAGS) $(LDFLAGS)
############ misc.
@ -112,7 +128,7 @@ CLEAN += $(junk) $(foreach dir,$(DIRS),$(addprefix $(dir), $(junk)))
#endif
#
#%.d: %.c
# depend.sh $(CFLAGS) $< > $@
# depend.sh $(ALL_CPPFLAGS) $(ALL_CFLAGS) $< > $@
############
# don't want to type "make procps-$(TARVERSION).tar.gz"
@ -140,21 +156,21 @@ install: $(filter-out $(SKIP) $(addprefix $(DESTDIR),$(SKIP)),$(INSTALL))
############ prog.c --> prog.o
%.o : %.c
$(CC) $(CFLAGS) -c -o $@ $^
$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c -o $@ $^
w.o: w.c
$(CC) $(CFLAGS) $(W_SHOWFROM) -c $<
$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) $(W_SHOWFROM) -c $<
############ prog.o --> prog
pmap w uptime tload free sysctl vmstat utmp pgrep skill: % : %.o $(LIBPROC)
$(CC) $(LDFLAGS) -o $@ $^
$(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) -o $@ $^
top: % : %.o $(LIBPROC)
$(CC) $(LDFLAGS) -o $@ $^ $(CURSES)
$(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) -o $@ $^ $(CURSES)
watch: % : %.o
$(CC) $(LDFLAGS) -o $@ $^ $(CURSES)
$(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) -o $@ $^ $(CURSES)
############ progX --> progY

1
NEWS
View File

@ -1,5 +1,6 @@
procps-3.1.11 --> procps-3.1.12
required flags moved out of CFLAGS #205429
RPM generation handles /lib64
WCHAN skips leading '.'
vmstat: numerous new features

3
README
View File

@ -16,9 +16,6 @@ INSTALLATION
named t, v, and p to ensure that the correct libproc
(the new one) is used during your testing.
If you need to add a compiler option, use CC to do it:
make CC='gcc -foo'
You may set SKIP to avoid building or installing things.
For example:

View File

@ -29,7 +29,7 @@ endif
# Separate rule for this directory, to use -fpic or -fPIC
$(filter-out proc/version.o,$(LIBOBJ)): proc/%.o: proc/%.c
$(CC) -c $(CFLAGS) $(LIBFLAGS) $< -o $@
$(CC) -c $(ALL_CPPFLAGS) $(ALL_CFLAGS) $(LIBFLAGS) $< -o $@
LIB_X := COPYING module.mk library.map
TARFILES += $(LIBSRC) $(LIBHDR) $(addprefix proc/,$(LIB_X))
@ -51,7 +51,7 @@ proc/$(SONAME): $(LIBOBJ)
# AUTOMATIC DEPENDENCY GENERATION -- GCC AND GNUMAKE DEPENDENT
proc/.depend: $(LIBSRC) $(LIBHDR)
$(strip $(CC) $(LIB_CFLAGS) -MM -MG $(LIBSRC) > $@)
$(strip $(CC) $(ALL_CPPFLAGS) $(LIB_CFLAGS) -MM -MG $(LIBSRC) > $@)
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(MAKECMDGOALS),tar)
@ -74,4 +74,4 @@ $(lib)/$(SONAME) : proc/$(SONAME)
proc/version.o: proc/version.c proc/version.h
$(CC) $(CFLAGS) $(LIBFLAGS) -DVERSION=\"$(VERSION)\" -DSUBVERSION=\"$(SUBVERSION)\" -DMINORVERSION=\"$(MINORVERSION)\" -c -o $@ $<
$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) $(LIBFLAGS) -DVERSION=\"$(VERSION)\" -DSUBVERSION=\"$(SUBVERSION)\" -DMINORVERSION=\"$(MINORVERSION)\" -c -o $@ $<

View File

@ -20,14 +20,14 @@ PS_X := COPYING HACKING TRANSLATION common.h module.mk it p ps.1 regression
TARFILES += $(PSSRC) $(addprefix ps/,$(PS_X))
ps/ps: $(PSOBJ) $(LIBPROC)
$(CC) $(LDFLAGS) -o $@ $^
$(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) -o $@ $^
# This just adds the stacktrace code
ps/debug: $(PSOBJ) stacktrace.o $(LIBPROC)
$(CC) -o $@ $^ -lefence
$(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) -o $@ $^ -lefence
$(PSOBJ): %.o: %.c ps/common.h proc/$(SONAME)
$(CC) -c $(CFLAGS) $< -o $@
$(CC) -c $(ALL_CPPFLAGS) $(ALL_CFLAGS) $< -o $@
ps/stacktrace.o: ps/stacktrace.c