-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile.in
172 lines (129 loc) · 4.04 KB
/
Makefile.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
#
# Makefile for rasterview, a CUPS/PWG Raster viewing program.
#
# Copyright © 2002-2023 by Michael R Sweet
#
# Licensed under Apache License v2.0. See the file "LICENSE" for more
# information.
#
# Version...
VERSION = @VERSION@
# Installation directories
BUILDROOT = $(DSTROOT)$(RPM_BUILD_ROOT)$(DESTDIR)
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
datadir = @datadir@
datarootdir = @datarootdir@
desktopdir = @desktopdir@
# Compiler definitions...
ARCHFLAGS = @ARCHFLAGS@
CC = @CC@
CFLAGS = $(ARCHFLAGS) $(CPPFLAGS) $(OPTIM) @CFLAGS@ @DEFS@
CP = @CP@
CODE_SIGN = @CODE_SIGN@
CPPFLAGS = @CPPFLAGS@
CSFLAGS = -s "$${CODESIGN_IDENTITY:=-}" @CSFLAGS@ --timestamp
CXX = @CXX@
CXXFLAGS = $(ARCHFLAGS) $(CPPFLAGS) $(OPTIM) @CXXFLAGS@ @DEFS@
FLTKCONFIG = @FLTKCONFIG@
LDFLAGS = $(ARCHFLAGS) $(OPTIM) @LDFLAGS@
LIBS = @LIBS@
OPTIM = @OPTIM@
MKDIR = @MKDIR@ -p
RM = @RM@ -f
SHELL = /bin/sh
# Rules for compiling...
.SUFFIXES: .c .cxx .o
.c.o:
$(CC) $(CFLAGS) -c $<
.cxx.o:
$(CXX) $(CXXFLAGS) -c $<
# Objects...
RVOBJS = \
RasterDisplay.o \
RasterView.o \
raster-error.o \
raster-stream.o \
main.o
OBJS = \
$(RVOBJS) \
testcie.o \
testraster.o
TESTS = \
testcie \
testraster
# Standard install targets...
all: rasterview
clean:
$(RM) rasterview $(TESTS)
$(RM) RasterView.app/Contents/MacOS/RasterView
$(RM) $(OBJS)
$(RM) *.bck
$(RM) *~
depend:
$(CC) -MM $(CPPFLAGS) *.c | sed -e '1,$$s/ \/usr\/include\/[^ ]*//g' -e '1,$$s/ \/usr\/local\/include\/[^ ]*//g' | grep -v '^ \\' >Dependencies
$(CXX) -MM $(CPPFLAGS) *.cxx | sed -e '1,$$s/ \/usr\/include\/[^ ]*//g' -e '1,$$s/ \/usr\/local\/include\/[^ ]*//g' | grep -v '^ \\' >>Dependencies
distclean: clean
$(RM) -r autom4te*
$(RM) config.*
$(RM) Makefile
install: all @INSTALLDESKTOP@
$(MKDIR) $(BUILDROOT)$(bindir)
cp rasterview $(BUILDROOT)$(bindir)
install-desktop:
$(MKDIR) $(BUILDROOT)$(desktopdir)
cp rasterview.desktop $(BUILDROOT)$(desktopdir)
$(MKDIR) $(BUILDROOT)$(datadir)/icons/hicolor/32x32/apps
cp rasterview-32.png $(BUILDROOT)$(datadir)/icons/hicolor/32x32/apps/rasterview.png
$(MKDIR) $(BUILDROOT)$(datadir)/icons/hicolor/128x128/apps
cp rasterview-128.png $(BUILDROOT)$(datadir)/icons/hicolor/128x128/apps/rasterview.png
$(MKDIR) $(BUILDROOT)$(datadir)/mime/packages
cp rasterview.xml $(BUILDROOT)$(datadir)/mime/packages
uninstall: @UNINSTALLDESKTOP@
$(RM) $(BUILDROOT)$(bindir)/rasterview
uninstall-desktop:
$(RM) $(desktopdir)/rasterview.desktop
$(RM) $(datadir)/icons/hicolor/32x32/apps/rasterview.png
$(RM) $(datadir)/icons/hicolor/128x128/apps/rasterview.png
$(RM) $(datadir)/mime/packages/rasterview.xml
test: $(TESTS)
# Make a disk image with the compiled program on macOS...
dmg: all
echo Signing RasterView application bundle
codesign -f $(CSFLAGS) RasterView.app
echo Creating archive for notarization
rm -f RasterView.zip
ditto -c -k --keepParent RasterView.app RasterView.zip
echo Notarizing application
xcrun notarytool submit RasterView.zip \
--apple-id "$${APPLEID}" \
--keychain-profile "AC_$${TEAMID}" \
--team-id "$${TEAMID}" \
--wait
echo Making disk image
rm -f rasterview-$(VERSION).dmg
dmgbuild -s dmgbuild.py "RasterView $(VERSION)" ~/Desktop/rasterview-$(VERSION)-macos.dmg
# Make an RPM for Linux...
rpm: all
epm -v -f rpm -nsm --output-dir dist rasterview
mv dist/*.rpm .
rm -rf dist
# Build the rasterview program...
rasterview: $(RVOBJS) Makefile
$(CXX) $(LDFLAGS) -o $@ $(RVOBJS) $(LIBS)
if test x`uname` = xDarwin; then \
test -d RasterView.app/Contents/MacOS || mkdir RasterView.app/Contents/MacOS; \
$(CP) rasterview RasterView.app/Contents/MacOS/RasterView; \
$(CODE_SIGN) $(CSFLAGS) RasterView.app; \
fi
$(RVOBJS): RasterView.h RasterDisplay.h
# Build the CIE test program...
testcie: testcie.o Makefile
$(CC) $(LDFLAGS) -o $@ testcie.o -lm
# Build the raster test program...
testraster: testraster.o raster-error.o raster-stream.o Makefile
$(CC) $(LDFLAGS) -o $@ testraster.o raster-error.o raster-stream.o -lm
# Dependencies...
$(OBJS): Makefile
include .depend