[cairo-commit] cairo-demo/png Makefile,1.11,1.12

Carl Worth commit at pdx.freedesktop.org
Mon Feb 21 12:32:19 PST 2005


Committed by: cworth

Update of /cvs/cairo/cairo-demo/png
In directory gabe:/tmp/cvs-serv25375/png

Modified Files:
	Makefile 
Log Message:

        * PS/Makefile:
        * X11/Makefile:
        * gtkcairo_slide/Makefile:
        * png/Makefile: Try to be kinder for portability by not including
        gcc-specific wanring options in the Makefile. The options really
        are handy, so we provide an example in the Makefile for how users
        who want them can get at them.


Index: Makefile
===================================================================
RCS file: /cvs/cairo/cairo-demo/png/Makefile,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- Makefile	11 Nov 2004 18:25:26 -0000	1.11
+++ Makefile	21 Feb 2005 20:32:17 -0000	1.12
@@ -1,11 +1,24 @@
-EXAMPLES=bevels caps_joins datapattern hering outline spiral splines_tolerance snapping stars text text-rotate
+EXAMPLES=bevels caps_joins hering outline spiral splines_tolerance snapping stars text text-rotate
 
-CFLAGS+=-g -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls `pkg-config --cflags cairo libpng`
-LDFLAGS+=`pkg-config --libs cairo libpng`
+# I'd like to put a bunch of compiler-specific warning flags here, but
+# I don't know a good way to choose the right flags based on the
+# compiler in use.
+#
+# So, for now, if you want more warnings, set them in CFLAGS before
+# calling make. For example, for gcc:
+#
+# CFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -fno-strict-aliasing" make
 
-all: ${EXAMPLES}
+MYCFLAGS=`pkg-config --cflags cairo libpng`
+MYLDFLAGS=`pkg-config --libs cairo libpng`
 
-${EXAMPLES}: write_png.o
+all: $(EXAMPLES)
+
+%.o: %.c
+	$(CC) -c $(CFLAGS) $(CPPFLAGS) ${MYCFLAGS} $< -o $@
+
+%: %.c write_png.o
+	$(CC) $(CFLAGS) $(CPPFLAGS) ${MYCFLAGS} ${MYLDFLAGS} $^ -o $@
 
 write_png.o: write_png.c write_png.h
 




More information about the cairo-commit mailing list