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

[wmx] [PATCH] wm2: separate preprocessor and linker flags

Bernhard R. Link - Sun Jan 03 16:39:09 2010

Use INCS when compiling, LDFLAGS when linking.
Thus changing those variables by giving make arguments
is easier, as they have less side effects.

--- a/Makefile
+++ b/Makefile
@@ -4,20 +4,21 @@ INCS	= -I/usr/X11R6/include
 
 CC	= gcc
 CCC	= g++
-CFLAGS	= -O2 -Wall $(INCS)
+CFLAGS	= -O2 -Wall
+LDFLAGS =
 OBJECTS	= Border.o Buttons.o Client.o Events.o Main.o Manager.o Rotated.o
 
 .c.o:
-	$(CC) -c $(CFLAGS) $<
+	$(CC) -c $(CFLAGS) $(INCS) $<
 
 .C.o:
-	$(CCC) -c $(CFLAGS) $<
+	$(CCC) -c $(CFLAGS) $(INCS) $<
 
 wm2:	$(OBJECTS)
-	$(CCC) -o wm2 $(OBJECTS) $(LIBS)
+	$(CCC) -o wm2 $(CFLAGS) $(LDFLAGS) $(OBJECTS) $(LIBS)
 
 depend:
-	makedepend -- $(CFLAGS) -- *.C
+	makedepend -- $(CFLAGS) $(INCS) -- *.C
 
 clean:
 	rm -f *.o core



Next: