forked from michaelrsweet/rasterview
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.in
164 lines (126 loc) · 3.92 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
#
# Makefile for rasterview, a CUPS/PWG Raster viewing program.
#
# Copyright © 2002-2021 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@
CODESIGN_IDENTITY = -
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 \
error.o \
raster.o \
main.o
OBJS = \
$(RVOBJS) \
testcie.o
# Standard install targets...
all: rasterview testcie
clean:
$(RM) rasterview testcie
$(RM) $(OBJS)
$(RM) *.bck
$(RM) *~
depend:
makedepend -Y -f .depend *.c *.cxx
distclean: clean
$(RM) -r autom4te*
$(RM) config.*
$(RM) Makefile
$(RM) RasterView.app/Contents/MacOS/rasterview
install: all @INSTALLDESKTOP@
$(MKDIR) $(BUILDROOT)$(bindir)
cp rasterview $(BUILDROOT)$(bindir)
install-desktop:
$(MKDIR) $(BUILDROOT)$(desktopdir)/Development
cp rasterview.desktop $(BUILDROOT)$(desktopdir)/Development
$(MKDIR) $(BUILDROOT)$(datadir)/mimelnk/application
cp vnd.cups-raster.desktop $(BUILDROOT)$(datadir)/mimelnk/application
$(MKDIR) $(BUILDROOT)$(datadir)/mimelnk/image
cp pwg-raster.desktop $(BUILDROOT)$(datadir)/mimelnk/image
cp urf.desktop $(BUILDROOT)$(datadir)/mimelnk/image
$(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
uninstall: @UNINSTALLDESKTOP@
$(RM) $(BUILDROOT)$(bindir)/rasterview
uninstall-desktop:
$(RM) $(desktopdir)/Graphics/rasterview.desktop
$(RM) $(datadir)/mimelnk/application/vnd.cups-raster.desktop
$(RM) $(datadir)/mimelnk/image/pwg-raster.desktop
$(RM) $(datadir)/mimelnk/image/urf.desktop
$(RM) $(datadir)/icons/hicolor/32x32/apps/rasterview.png
$(RM) $(datadir)/icons/hicolor/128x128/apps/rasterview.png
# 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 altool --notarize-app -f RasterView.zip \
--primary-bundle-id org.msweet.rasterview \
--username "$(APPLEID)" \
--password "@keychain:AC_$(TEAMID)" \
--asc-provider "$(TEAMID)"
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
# Dependencies...
$(OBJS): Makefile
include .depend