Debian Codegraph @

Makefile.Solaris

raw
1 ##############################################################################
2 # Solaris Makefile for qiv - Quick Image Viewer - http://qiv.spiegl.de/
3 # User Options
4 #############################################################################
5
6 # Directory where qiv will be installed under.
7 PREFIX = /usr/local
8
9 # Fonts to use for statusbar and comments
10 STATUSBAR_FONT = "fixed"
11 COMMENT_FONT = "fixed"
12 ARTIST_FONT = "Monospace 10"
13
14 # Cursor to use on qiv windows - see
15 # /usr/X11R6/include/X11/cursorfont.h for more choices.
16 CURSOR = 84
17
18 # Should image be centered on screen by default? 1=yes, 0=no.
19 CENTER = 1
20
21 # Should images be filtered by extension? 1=yes, 0=no.
22 FILTER = 1
23
24 # This sets the file extentions to filter on (other file types will be
25 # skipped.) It should reflect whatever is compiled into imlib.
26 # The latest version of imlib has removed imagemagick fallback support,
27 # so some extensions (XBM TGA) have been removed.
28 EXTNS = GIF TIFF XPM PNG PPM PNM PGM PCX BMP EIM JPEG SVG WMF ICO
29
30 # Comment this line out if your system doesn't have getopt_long().
31 #GETOPT_LONG = -DHAVE_GETOPT_LONG
32
33 # This program will be run on the manual page after it is installed.
34 # If you don't want to compress the manpage, change it to 'true'.
35 COMPRESS_PROG = gzip -9f
36
37 # Comment this line out if your system doesn't have lcms2 installed
38 # (for minimal Color Management support)
39 LCMS = -DSUPPORT_LCMS
40
41 # Comment this line out if you do not want to use libmagic to
42 # identify if a file is an image
43 MAGIC = -DHAVE_MAGIC
44 # Uncomment if libmagic is installed in a non standard place
45 #MAGIC_PREFIX = /data/magictools
46
47 # Comment this line out if you do not want to use libexif to
48 # display the exif contents of a jpg
49 EXIF = -DHAVE_EXIF
50
51 ######################################################################
52 # Variables and Rules
53 # Do not edit below here!
54 ######################################################################
55
56 ifeq ($(origin CC),default)
57 CC = gcc
58 endif
59
60 CFLAGS = -O2 -Wall -fomit-frame-pointer -finline-functions \
61 -fcaller-saves -ffast-math -fno-strength-reduce \
62 -fthread-jumps #-march=pentium #-DSTAT_MACROS_BROKEN
63
64 INCLUDES := $(shell pkg-config --cflags gdk-2.0 imlib2)
65 LIBS := $(shell pkg-config --libs gdk-2.0 imlib2) -lX11 lXext -lgio-2.0
66
67 # [as] thinks that this is not portable enough:
68 # [lc] I use a virtual screen of 1600x1200, and the resolution is 1024x768,
69 # so I changed (in main.c) how screen_[x,y] is obtained; it seems that gtk
70 # 1.2 cannot give the geometry of viewport, so I borrowed from the source
71 # of xvidtune the code for calling XF86VidModeGetModeLine, this requires
72 # the linking option -lXxf86vm.
73 #LIBS += -lXxf86vm
74
75 PROGRAM = qiv
76 OBJS = main.o image.o event.o options.o utils.o xmalloc.o
77 HEADERS = qiv.h
78 DEFINES = $(patsubst %,-DEXTN_%, $(EXTNS)) \
79 $(GETOPT_LONG) \
80 -DSTATUSBAR_FONT='$(STATUSBAR_FONT)' \
81 -DCOMMENT_FONT='$(COMMENT_FONT)' \
82 -DARTIST_FONT='$(ARTIST_FONT)' \
83 -DCENTER=$(CENTER) \
84 -DFILTER=$(FILTER) \
85 -DCURSOR=$(CURSOR) \
86 $(MAGIC) \
87 $(EXIF) \
88 $(LCMS)
89
90 ifndef GETOPT_LONG
91 OBJS += lib/getopt.o lib/getopt1.o
92 OBJS_G += lib/getopt.g lib/getopt1.g
93 endif
94
95 ifdef LCMS
96 INCLUDES += $(shell pkg-config --cflags lcms2)
97 LIBS += $(shell pkg-config --libs lcms2) -ljpeg -ltiff
98 endif
99
100 ifdef EXIF
101 INCLUDES += $(shell pkg-config --cflags libexif)
102 LIBS += $(shell pkg-config --libs libexif)
103 endif
104
105 ifdef MAGIC
106 ifdef MAGIC_PREFIX
107 INCLUDES += -I$(MAGIC_PREFIX)/include
108 LIBS += -L$(MAGIC_PREFIX)/lib
109 endif
110 LIBS += -lmagic -lz
111 endif
112
113 PROGRAM_G = qiv-g
114 OBJS_G = $(OBJS:.o=.g)
115 DEFINES_G = $(DEFINES) -DDEBUG
116
117 ######################################################################
118
119 all: $(PROGRAM)
120
121 $(PROGRAM): $(OBJS)
122 $(CC) $(CFLAGS) $(DEFINES) $(OBJS) $(LIBS) -o $(PROGRAM)
123
124 $(OBJS): %.o: %.c $(HEADERS)
125 $(CC) -c $(CFLAGS) $(DEFINES) $(INCLUDES) $< -o $@
126
127 main.o: main.h
128
129 ######################################################################
130
131 debug: $(PROGRAM_G)
132
133 $(PROGRAM_G): $(OBJS_G)
134 $(CC) -g $(CFLAGS) $(DEFINES_G) $(LIBS) $(OBJS_G) -o $(PROGRAM_G)
135
136 $(OBJS_G): %.g: %.c $(HEADERS)
137 $(CC) -c -g $(CFLAGS) $(DEFINES_G) $(INCLUDES) $< -o $@
138
139 ######################################################################
140
141 clean :
142 @echo "Cleaning up..."
143 rm -f $(OBJS) $(OBJS_G)
144
145 distclean : clean
146 rm -f $(PROGRAM) $(PROGRAM_G)
147
148 install: $(PROGRAM)
149 @echo "Installing QIV..."
150 @if [ ! -d $(PREFIX)/bin ]; then \
151 install -d -m 0755 $(PREFIX)/bin; \
152 echo install -d -m 0755 $(PREFIX)/bin; \
153 fi
154 install -s -m 0755 $(PROGRAM) $(PREFIX)/bin
155 @if [ ! -d $(PREFIX)/man/man1 ]; then \
156 echo install -d -m 0755 $(PREFIX)/man/man1; \
157 install -d -m 0755 $(PREFIX)/man/man1; \
158 fi
159 install -m 0644 $(PROGRAM).1 $(PREFIX)/man/man1
160 $(COMPRESS_PROG) $(PREFIX)/man/man1/$(PROGRAM).1
161 install -D -m 0644 qiv.png $(PREFIX)/share/pixmaps/qiv.png
162 install -D -m 0644 qiv.desktop $(PREFIX)/share/applications/qiv.desktop
163 @if [ ! -e $(PREFIX)/share/pixmaps ]; then \
164 echo install -d -m 0755 $(PREFIX)/share/pixmaps; \
165 install -d -m 0755 $(PREFIX)/share/pixmaps; \
166 fi
167 install -m 0644 qiv.png $(PREFIX)/share/pixmaps/qiv.png
168 @if [ ! -e $(PREFIX)/share/applications ]; then \
169 echo install -d -m 0755 $(PREFIX)/share/applications; \
170 install -d -m 0755 $(PREFIX)/share/applications; \
171 fi
172 install -m 0644 qiv.desktop $(PREFIX)/share/applications/qiv.desktop
173 @if ./qiv -f ./intro.jpg ; \
174 then echo "-- Test Passed --" ; \
175 else echo "-- Test Failed --" ; \
176 fi
177 @echo "\nDont forget to look into the \"qiv-command\" file and install it!\n-> cp qiv-command.example $(PREFIX)/bin/qiv-command\n\n"
178
179 # the end... ;-)