[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1336: CFLAGS shouldn't be used when linking

Package: procps
Version: 0.97-4

In the Makefile, CFLAGS were used when linking the various object
files.  This shouldn't be the case and it would cause problems when
one wishes to compile the source code with '-g' but not to link it
with '-g'.

Here is a patch that fixes the problem:

PS It might be desirable to define SLDFLAGS in terms of LDFLAGS.

--- procps-0.97/Makefile.orig	Sat Sep  9 16:15:42 1995
+++ procps-0.97/Makefile	Sat Sep  9 16:17:08 1995
@@ -53,7 +53,7 @@
 	$(CC) $(CFLAGS) $(TTY_FULL_DEVNO) -c snap.c

 ps:	$(liba) ps.o
-	$(CC) $(CFLAGS) $(LDFLAGS) -o ps ps.o -L. -l$(lib) $(LIBS)
+	$(CC) $(LDFLAGS) -o ps ps.o -L. -l$(lib) $(LIBS)

 #w.o:	w.c ps.h whattime.h
 #	$(CC) $(CFLAGS) $(W_SHOWFROM) -c w.c $(LIBS)
@@ -65,40 +65,40 @@
 	$(CC) $(CFLAGS) -I/usr/include/bsd -c w.c

 #w:	$(liba) w.o
-#	$(CC) $(CFLAGS) $(LDFLAGS) -o w w.o -L. -l$(lib) $(LIBS)
+#	$(CC) $(LDFLAGS) -o w w.o -L. -l$(lib) $(LIBS)

 w:	w.o attime.o
-	$(CC) $(CFLAGS) $(LDFLAGS) -o w w.o attime.o -lbsd
+	$(CC) $(LDFLAGS) -o w w.o attime.o -lbsd

 psupdate:	$(liba) psupdate.o
-	$(CC) $(CFLAGS) $(SLDFLAGS) -o psupdate psupdate.o -L. -l$(lib) $(LIBS)
+	$(CC) $(SLDFLAGS) -o psupdate psupdate.o -L. -l$(lib) $(LIBS)

 top:	$(liba) top.o signals.o
-	$(CC) $(CFLAGS) $(LDFLAGS) -o top top.o signals.o -ltermcap -L. -l$(lib) $(LIBS)
+	$(CC) $(LDFLAGS) -o top top.o signals.o -ltermcap -L. -l$(lib) $(LIBS)

 uptime:	$(liba) uptime.o
-	$(CC) $(CFLAGS) $(SLDFLAGS) uptime.o -o uptime -L. -l$(lib) $(LIBS)
+	$(CC) $(SLDFLAGS) uptime.o -o uptime -L. -l$(lib) $(LIBS)

 tload:	$(liba) tload.o
-	$(CC) $(CFLAGS) $(SLDFLAGS) tload.o -o tload -L. -l$(lib) $(LIBS)
+	$(CC) $(SLDFLAGS) tload.o -o tload -L. -l$(lib) $(LIBS)

 free:	free.o
-	$(CC) $(CFLAGS) $(SLDFLAGS) free.o -o free $(LIBS)
+	$(CC) $(SLDFLAGS) free.o -o free $(LIBS)

 utmp:	utmp.o
-	$(CC) $(CFLAGS) $(LDFLAGS) utmp.o -o utmp $(LIBS)
+	$(CC) $(LDFLAGS) utmp.o -o utmp $(LIBS)

 fuser:	fuser.o signals.o
-	$(CC) $(CFLAGS) $(SLDFLAGS) fuser.o signals.o -o fuser $(LIBS)
+	$(CC) $(SLDFLAGS) fuser.o signals.o -o fuser $(LIBS)

 killall: killall.o signals.o
-	$(CC) $(CFLAGS) $(SLDFLAGS) killall.o signals.o -o killall $(LIBS)
+	$(CC) $(SLDFLAGS) killall.o signals.o -o killall $(LIBS)

 pstree:	pstree.o
-	$(CC) $(CFLAGS) $(SLDFLAGS) -o pstree pstree.o -ltermcap $(LIBS)
+	$(CC) $(SLDFLAGS) -o pstree pstree.o -ltermcap $(LIBS)

 vmstat: vmstat.o
-	$(CC) $(CFLAGS) $(SLDFLAGS) -o vmstat vmstat.o $(LIBS)
+	$(CC) $(SLDFLAGS) -o vmstat vmstat.o $(LIBS)

 xproc/Makefile: xproc/Imakefile
A.  B <=> True			B.  A <=> False
Email:  Herbert Xu ~{PmV>HI~} <herbert@greathan.apana.org.au>
PGP Key:  pgp-public-keys@pgp.mit.edu or any other key sites

Reply to: