VirtualBox

source: vbox/trunk/src/libs/libpng-1.2.8/contrib/gregbook/Makefile.unx@ 8822

最後變更 在這個檔案從8822是 6395,由 vboxsync 提交於 17 年 前

export libpng and zlib so Windows and OS/2 build cleanly.

  • 屬性 svn:eol-style 設為 native
檔案大小: 2.9 KB
 
1# Sample makefile for rpng-x / rpng2-x / wpng using gcc and make.
2# Greg Roelofs
3# Last modified: 7 March 2002
4#
5# The programs built by this makefile are described in the book,
6# "PNG: The Definitive Guide," by Greg Roelofs (O'Reilly and
7# Associates, 1999). Go buy a copy, eh? Buy some for friends
8# and family, too. (Not that this is a blatant plug or anything.)
9#
10# Invoke this makefile from a shell prompt in the usual way; for example:
11#
12# make -f Makefile.unx
13#
14# This makefile assumes libpng and zlib have already been built or downloaded
15# and are both installed in /usr/local/{include,lib} (as indicated by the
16# PNG* and Z* macros below). Edit as appropriate--choose only ONE each of
17# the PNGINC, PNGLIB, ZINC and ZLIB lines.
18#
19# This makefile builds statically linked executables (against libpng and zlib,
20# that is), but that can be changed by uncommenting the appropriate PNGLIB and
21# ZLIB lines.
22
23
24# macros --------------------------------------------------------------------
25
26PNGINC = -I/usr/local/include/libpng12
27#PNGLIB = -L/usr/local/lib -lpng12 # dynamically linked against libpng
28PNGLIB = /usr/local/lib/libpng12.a # statically linked against libpng
29# or:
30#PNGINC = -I../libpng
31#PNGLIB = -L../libpng -lpng
32#PNGLIB = ../libpng/libpng.a
33
34ZINC = -I/usr/local/include
35#ZLIB = -L/usr/local/lib -lz # dynamically linked against zlib
36ZLIB = /usr/local/lib/libz.a # statically linked against zlib
37#ZINC = -I../zlib
38#ZLIB = -L../zlib -lz
39#ZLIB = ../zlib/libz.a
40
41#XINC = -I/usr/include # old-style, stock X distributions
42#XLIB = -L/usr/lib/X11 -lX11
43#XINC = -I/usr/openwin/include # Sun workstations (OpenWindows)
44#XLIB = -L/usr/openwin/lib -lX11
45XINC = -I/usr/X11R6/include # new X distributions (XFree86, etc.)
46XLIB = -L/usr/X11R6/lib -lX11
47
48INCS = $(PNGINC) $(ZINC) $(XINC)
49RLIBS = $(PNGLIB) $(ZLIB) $(XLIB) -lm
50WLIBS = $(PNGLIB) $(ZLIB)
51
52CC = gcc
53LD = gcc
54RM = rm -f
55CFLAGS = -O -Wall $(INCS)
56# [note that -Wall is a gcc-specific compilation flag ("most warnings on")]
57# [-ansi, -pedantic and -W can also be used]
58LDFLAGS =
59O = .o
60E =
61
62RPNG = rpng-x
63RPNG2 = rpng2-x
64WPNG = wpng
65
66ROBJS = $(RPNG)$(O) readpng$(O)
67ROBJS2 = $(RPNG2)$(O) readpng2$(O)
68WOBJS = $(WPNG)$(O) writepng$(O)
69
70EXES = $(RPNG)$(E) $(RPNG2)$(E) $(WPNG)$(E)
71
72
73# implicit make rules -------------------------------------------------------
74
75.c$(O):
76 $(CC) -c $(CFLAGS) $<
77
78
79# dependencies --------------------------------------------------------------
80
81all: $(EXES)
82
83$(RPNG)$(E): $(ROBJS)
84 $(LD) $(LDFLAGS) -o $@ $(ROBJS) $(RLIBS)
85
86$(RPNG2)$(E): $(ROBJS2)
87 $(LD) $(LDFLAGS) -o $@ $(ROBJS2) $(RLIBS)
88
89$(WPNG)$(E): $(WOBJS)
90 $(LD) $(LDFLAGS) -o $@ $(WOBJS) $(WLIBS)
91
92$(RPNG)$(O): $(RPNG).c readpng.h
93$(RPNG2)$(O): $(RPNG2).c readpng2.h
94$(WPNG)$(O): $(WPNG).c writepng.h
95
96readpng$(O): readpng.c readpng.h
97readpng2$(O): readpng2.c readpng2.h
98writepng$(O): writepng.c writepng.h
99
100
101# maintenance ---------------------------------------------------------------
102
103clean:
104 $(RM) $(EXES) $(ROBJS) $(ROBJS2) $(WOBJS)
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette