Makefile 17.5 KB
Newer Older
Adam Dingle's avatar
Adam Dingle committed
1
PROGRAM = shotwell
2

3
VERSION = 0.8.1+trunk
4
GETTEXT_PACKAGE = $(PROGRAM)
Adam Dingle's avatar
Adam Dingle committed
5
BUILD_ROOT = 1
6

7
VALAC = valac
8
MIN_VALAC_VERSION = 0.9.8
9 10 11
INSTALL_PROGRAM = install
INSTALL_DATA = install -m 644

12
# defaults that may be overridden by configure.mk
13
PREFIX=/usr/local
14
SCHEMA_FILE_DIR=/etc/gconf/schemas
15 16
BUILD_RELEASE=1

17
-include configure.mk
18

19
VALAFLAGS = -g --enable-checking --thread $(USER_VALAFLAGS)
20
DEFINES=_PREFIX='"$(PREFIX)"' _VERSION='"$(VERSION)"' GETTEXT_PACKAGE='"$(GETTEXT_PACKAGE)"' \
21
     _LANG_SUPPORT_DIR='"$(SYSTEM_LANG_DIR)"'
22

23
EXPORT_FLAGS = -export-dynamic
24

25
SUPPORTED_LANGUAGES=fr de it es pl et sv sk lv pt bg bn nl da zh_CN el ru pa hu en_GB uk ja fi zh_TW cs nb id th sl hr ar ast ro sr lt gl tr ca ko kk pt_BR eu he mk
26 27 28
LOCAL_LANG_DIR=locale-langpack
SYSTEM_LANG_DIR=$(DESTDIR)$(PREFIX)/share/locale

29
include units.mk
30
include plugins/plugins.mk
31 32

UNUNITIZED_SRC_FILES = \
33 34 35 36
	main.vala \
	AppWindow.vala \
	CollectionPage.vala \
	Thumbnail.vala \
37
	ThumbnailCache.vala \
38
	CheckerboardLayout.vala \
39
	PhotoPage.vala \
40 41
	Page.vala \
	ImportPage.vala \
42
	GPhoto.vala \
43
	SortedList.vala \
44 45 46 47
	EventsDirectoryPage.vala \
	Dimensions.vala \
	Box.vala \
	Photo.vala \
48
	Orientation.vala \
Jim Nelson's avatar
Jim Nelson committed
49
	BatchImport.vala \
50
	Dialogs.vala \
51
	Resources.vala \
52
	Debug.vala \
53
	Sidebar.vala \
54
	ColorTransformation.vala \
55
	EditingTools.vala \
56 57
	DataObject.vala \
	DataCollection.vala \
58
	LibraryWindow.vala \
59
	CameraTable.vala \
60
	DirectWindow.vala \
61 62 63
	Properties.vala \
	CustomComponents.vala \
	Config.vala \
64
	Event.vala \
65
	International.vala \
66
	AppDirs.vala \
67
	PixbufCache.vala \
68 69
	WebConnectors.vala \
	FacebookConnector.vala \
70 71
	CommandManager.vala \
	Commands.vala \
72
	SlideshowPage.vala \
73
	LibraryFiles.vala \
74
	FlickrConnector.vala \
75
	YandexConnector.vala \
76 77
	Printing.vala \
	Tag.vala \
78
	TagPage.vala \
79
	PicasaConnector.vala \
80
	PiwigoConnector.vala \
81
	YouTubeConnector.vala \
82 83 84 85
	Screensaver.vala \
	PhotoFileAdapter.vala \
	PhotoFileFormat.vala \
	PhotoFileSniffer.vala \
86
	PhotoMetadata.vala \
87 88 89 90
	GRaw.vala \
	GdkSupport.vala \
	JfifSupport.vala \
	RawSupport.vala \
Jim Nelson's avatar
Jim Nelson committed
91 92
	MimicManager.vala \
	TrashPage.vala \
93
	PngSupport.vala \
94
	Exporter.vala \
95 96
	DirectoryMonitor.vala \
	LibraryMonitor.vala \
Jim Nelson's avatar
Jim Nelson committed
97
	OfflinePage.vala \
98 99 100 101 102
	LastImportPage.vala \
	AlienDatabase.vala \
	AlienDatabaseImportJob.vala \
	AlienDatabaseImportDialog.vala \
	FSpotDatabaseDriver.vala \
103
	FSpotDatabaseTables.vala \
104
	VideoSupport.vala \
105
	VideosPage.vala \
106 107 108
	Tombstone.vala \
	MetadataWriter.vala \
	Application.vala \
109
	TimedQueue.vala \
110
	MediaPage.vala \
111
	MediaDataRepresentation.vala \
Jim Nelson's avatar
Jim Nelson committed
112 113
	DesktopIntegration.vala \
	FlaggedPage.vala \
114 115
	MediaInterfaces.vala \
	MediaMetadata.vala \
116
	VideoMetadata.vala \
117 118 119
	MediaMonitor.vala \
	PhotoMonitor.vala \
	VideoMonitor.vala
120

121
VAPI_FILES = \
122
	libexif.vapi \
123
	libgphoto2.vapi \
124
	ExtendedPosix.vapi \
125
	LConv.vapi \
126
	libraw.vapi
127

128
RESOURCE_FILES = \
129 130
	photo.ui \
	collection.ui \
131
	import.ui \
132 133 134
	fullscreen.ui \
	import_queue.ui \
	events_directory.ui \
135
	event.ui \
136
	direct.ui \
Jim Nelson's avatar
Jim Nelson committed
137
	tags.ui \
138
	trash.ui \
139
	offline.ui \
140
	media.ui \
141
	yandex_publish_model.glade \
142 143 144
	shotwell.glade \
	set_background_dialog.glade \
	video.ui
145

146 147 148 149 150
SYS_INTEGRATION_FILES = \
	shotwell.desktop.head \
	shotwell-viewer.desktop.head \
	shotwell.schemas

151
SRC_HEADER_FILES = \
152
	gphoto.h
153

Jim Nelson's avatar
Jim Nelson committed
154 155 156 157 158 159
TEXT_FILES = \
	AUTHORS \
	COPYING \
	INSTALL \
	MAINTAINERS \
	NEWS \
160 161
	README \
	THANKS
Jim Nelson's avatar
Jim Nelson committed
162

163
ICON_FILES = \
164
	all-rejected.png \
165 166
	crop-pivot-reticle.png \
	crop.svg \
167 168 169 170
	drag_nub.png \
	enhance.png \
	five-star-filter.svg \
	five-stars.svg \
171 172
	flag-page.png \
	flag-trinket.png \
173 174
	four-star-filter-plus.svg \
	four-stars.svg \
175
	image-adjust.svg \
176 177 178 179
	import-all.png \
	import.svg \
	make-primary.svg \
	merge.svg \
180 181
	multiple-events.png \
	multiple-tags.png \
182
	noninterpretable-video.png \
183
	one-event.png \
184 185
	one-star-filter-plus.svg \
	one-star.svg \
186
	one-tag.png \
187 188 189 190
	pin-toolbar.svg \
	publish.png \
	redeye.png \
	rejected.svg \
191 192
	shotwell-16.svg \
	shotwell-24.svg \
193 194 195
	shotwell.ico \
	shotwell-street.jpg \
	shotwell.svg \
196
	sprocket.png \
197 198 199
	three-star-filter-plus.svg \
	three-stars.svg \
	two-star-filter-plus.svg \
200
	two-stars.svg \
201
	videos-page.png \
202 203
	zoom-in.png \
	zoom-out.png
204 205

HELP_FILES = \
206
	edit-adjustments.page \
207 208 209
	edit-crop.page \
	edit-enhance.page \
	edit-external.page \
210
	edit-nondestructive.page \
211 212
	edit-redeye.page \
	edit-rotate.page \
213
	edit-time-date.page \
214
	edit-undo.page \
215
	formats.page \
216 217 218
	import-camera.page \
	import-file.page \
	import-f-spot.page \
219
	import-memorycard.page \
220
	index.page \
221
	organize-event.page \
222
	organize-flag.page \
223
	organize-rating.page \
224
	organize-remove.page \
225 226
	organize-tag.page \
	organize-title.page \
227
	other-files.page \
228 229 230
	other-missing.page \
	other-multiple.page \
	running.page \
231
	share-background.page \
232
	share-export.page \
233
	share-print.page \
234
	share-send.page \
235
	share-slideshow.page \
236 237 238 239
	share-upload.page \
	view-displaying.page \
	view-information.page \
	view-sidebar.page
240 241

HELP_IMAGES = \
242
	crop_thirds.jpg \
243
	editing_overview.png \
244
	edit_toolbar.png \
245
	shotwell_logo.png \
246
	trash_process.png
247

248
VAPI_DIRS = \
249
	./vapi
250

251
HEADER_DIRS = \
252
	./vapi
253

254
LOCAL_PKGS = \
255
	ExtendedPosix \
256
	posix \
257
	LConv
258

259 260
# libraw is not listed (see note below); when libraw-config is no longer needed, it should be
# added to this list
261
EXT_PKGS = \
262
	atk \
263 264
	dbus-glib-1 \
	gconf-2.0 \
265
	gdk-2.0 \
266
	gdk-x11-2.0 \
267
	gee-1.0 \
268
	gexiv2 \
269
	gnome-vfs-2.0 \
270 271
	gstreamer-0.10 \
	gstreamer-base-0.10 \
272
	gtk+-2.0 \
273
	glib-2.0 \
274 275
	gudev-1.0 \
	json-glib-1.0 \
276
	libexif \
277 278 279
	libgphoto2 \
	libsoup-2.4 \
	libxml-2.0 \
280
	sqlite3 \
281
	unique-1.0 \
282 283
	webkit-1.0 \
	gmodule-2.0
284

285 286
DIRECT_LIBS =

287
LIBRAW_PKG = \
288 289
	libraw

290 291
# libraw is handled separately (see note below); when libraw-config is no longer needed, the version
# should be added to this list
292
EXT_PKG_VERSIONS = \
293 294
	dbus-glib-1 >= 0.80 \
	gconf-2.0 >= 2.22.0 \
295
	gee-1.0 >= 0.5.0 \
296
	gexiv2 >= 0.2.0 \
297
	gtk+-2.0 >= 2.18.0 \
298
	glib-2.0 >= 2.24.0 \
299 300 301
	gstreamer-0.10 >= 0.10.28 \
	gstreamer-base-0.10 >= 0.10.28 \
	gudev-1.0 >= 145 \
302
	json-glib-1.0 >= 0.7.6 \
303
	libexif >= 0.6.16 \
304 305 306
	libgphoto2 >= 2.4.2 \
	libsoup-2.4 >= 2.26.0 \
	libxml-2.0 >= 2.6.32 \
307
	sqlite3 >= 3.5.9 \
308
	unique-1.0 >= 1.0.0 \
309 310
	webkit-1.0 >= 1.1.5 \
	gmodule-2.0 >= 2.24.0
311

312 313
DIRECT_LIBS_VERSIONS =

314 315 316
LIBRAW_VERSION = \
	0.9.0

317
VALA_PKGS = $(EXT_PKGS) $(LOCAL_PKGS) $(LIBRAW_PKG)
Jim Nelson's avatar
Jim Nelson committed
318

319 320 321 322
ifndef BUILD_DIR
BUILD_DIR=src
endif

323 324 325 326 327 328 329
DESKTOP_APPLICATION_NAME="Shotwell Photo Manager"
DESKTOP_APPLICATION_COMMENT="Organize your photos"
DESKTOP_APPLICATION_CLASS="Photo Manager"
DIRECT_EDIT_DESKTOP_APPLICATION_NAME="Shotwell Photo Viewer"
DIRECT_EDIT_DESKTOP_APPLICATION_CLASS="Photo Viewer"
TEMPORARY_DESKTOP_FILES = misc/shotwell.desktop misc/shotwell-viewer.desktop

330
# Process the units
331
UNIT_MKS := $(foreach unit,$(UNITS),src/$(unit)/mk/$(notdir $(unit)).mk)
332 333 334 335 336 337 338
include $(UNIT_MKS)

UNITIZE_DIR := src/.unitize
UNITIZE_ENTRIES := $(foreach group,$(APP_GROUPS),$(UNITIZE_DIR)/_$(group)_unitize_entry.vala)
UNITIZE_INITS := $(foreach nm,$(UNIT_NAMESPACES),$(UNITIZE_DIR)/_$(nm)Internals.vala)
UNITIZE_STAMP := $(UNITIZE_DIR)/.unitized

339 340 341
PLUGINS_DIR := plugins
PLUGINS_SO := $(foreach plugin,$(PLUGINS),$(PLUGINS_DIR)/$(plugin)/$(plugin).so)

342 343 344 345 346 347 348 349 350 351 352 353 354 355 356
EXPANDED_PO_FILES := $(foreach po,$(SUPPORTED_LANGUAGES),po/$(po).po)
EXPANDED_SRC_FILES := $(UNITIZED_SRC_FILES) $(foreach src,$(UNUNITIZED_SRC_FILES),src/$(src)) \
	$(UNITIZE_INITS) $(UNITIZE_ENTRIES)
EXPANDED_C_FILES := $(foreach file,$(subst src,$(BUILD_DIR),$(EXPANDED_SRC_FILES)),$(file:.vala=.c))
EXPANDED_OBJ_FILES := $(foreach file,$(subst src,$(BUILD_DIR),$(EXPANDED_SRC_FILES)),$(file:.vala=.o))
EXPANDED_SYS_INTEGRATION_FILES := $(foreach file,$(SYS_INTEGRATION_FILES),misc/$(file))
EXPANDED_ICON_FILES := $(foreach file,$(ICON_FILES),icons/$(file))
EXPANDED_VAPI_FILES := $(foreach vapi,$(VAPI_FILES),vapi/$(vapi))
EXPANDED_SRC_HEADER_FILES := $(foreach header,$(SRC_HEADER_FILES),vapi/$(header))
EXPANDED_RESOURCE_FILES := $(foreach res,$(RESOURCE_FILES),ui/$(res))
EXPANDED_HELP_FILES := $(foreach file,$(HELP_FILES),help/C/$(file))
EXPANDED_HELP_IMAGES := $(foreach file,$(HELP_IMAGES),help/C/figures/$(file))
VALA_STAMP := $(BUILD_DIR)/.stamp
LANG_STAMP := $(LOCAL_LANG_DIR)/.langstamp
MAKE_FILES := Makefile $(CONFIG_IN) $(UNIT_MKS) unitize.mk units.mk
357

358
DIST_FILES = Makefile configure minver $(EXPANDED_SRC_FILES) $(EXPANDED_VAPI_FILES) \
359
	$(EXPANDED_SRC_HEADER_FILES) $(EXPANDED_RESOURCE_FILES) $(TEXT_FILES) $(EXPANDED_ICON_FILES) \
360
	$(EXPANDED_SYS_INTEGRATION_FILES) $(EXPANDED_PO_FILES) po/shotwell.pot libraw-config \
361 362
	$(EXPANDED_HELP_FILES) $(EXPANDED_HELP_IMAGES) apport/shotwell.py $(UNIT_RESOURCES) $(UNIT_MKS) \
	unitize.mk units.mk
Jim Nelson's avatar
Jim Nelson committed
363

Adam Dingle's avatar
Adam Dingle committed
364
DIST_TAR = $(PROGRAM)-$(VERSION).tar
Jim Nelson's avatar
Jim Nelson committed
365
DIST_TAR_BZ2 = $(DIST_TAR).bz2
366
DIST_TAR_GZ = $(DIST_TAR).gz
Jim Nelson's avatar
Jim Nelson committed
367
PACKAGE_ORIG_GZ = $(PROGRAM)_`parsechangelog | grep Version | sed 's/.*: //'`.orig.tar.gz
368

369 370
VALAFLAGS := --vapidir=plugins/

371
VALA_CFLAGS := `pkg-config --cflags $(EXT_PKGS) $(DIRECT_LIBS) gthread-2.0` \
372
	$(foreach hdir,$(HEADER_DIRS),-I$(hdir)) \
373 374
	$(foreach def,$(DEFINES),-D$(def))

375
VALA_LDFLAGS := `pkg-config --libs $(EXT_PKGS) $(DIRECT_LIBS) gthread-2.0`
376 377 378 379

# setting CFLAGS in configure.mk overrides build type
ifndef CFLAGS
ifdef BUILD_DEBUG
380
CFLAGS = -O0 -g -pipe -fPIC
381
else
382 383
CFLAGS = -O2 -g -pipe -fPIC
endif
384
endif
385

386 387 388
# Required for gudev-1.0
CFLAGS += -DG_UDEV_API_IS_SUBJECT_TO_CHANGE

389 390 391
# Packaged libraw is not widely available, so we must fake what would be in its .pc file
# if not available.
LIBRAW_CONFIG=./libraw-config
392

393 394 395 396 397 398
ifdef ENABLE_BUILD_FOR_GLADE
all: $(PLUGINS_DIR) lib$(PROGRAM).so $(PROGRAM)
else
all: $(PLUGINS_DIR) $(PROGRAM)
endif

399 400
include src/plugins/mk/interfaces.mk

401
$(LANG_STAMP): $(EXPANDED_PO_FILES)
402 403 404
	@$(foreach po,$(SUPPORTED_LANGUAGES),`mkdir -p $(LOCAL_LANG_DIR)/$(po)/LC_MESSAGES ; \
		msgfmt -o $(LOCAL_LANG_DIR)/$(po)/LC_MESSAGES/shotwell.mo po/$(po).po`)
	@touch $(LANG_STAMP)
405

Jim Nelson's avatar
Jim Nelson committed
406
clean:
407 408 409
	rm -f $(EXPANDED_C_FILES)
	rm -f $(EXPANDED_OBJ_FILES)
	rm -f $(VALA_STAMP)
410
	rm -rf $(PROGRAM)-$(VERSION)
Adam Dingle's avatar
Adam Dingle committed
411
	rm -f $(PROGRAM)
412 413
	rm -rf $(LOCAL_LANG_DIR)
	rm -f $(LANG_STAMP)
414
	rm -f $(TEMPORARY_DESKTOP_FILES)
415
	rm -f lib$(PROGRAM).so
416
	rm -rf $(UNITIZE_DIR)
417 418 419
	rm -f $(PLUGIN_VAPIS)
	rm -f $(PLUGIN_HEADERS)
	rm -f $(PLUGIN_DEPS)
420 421
	rm -f $(PLUGINS_SO)
	@$(MAKE) --directory=plugins clean
Jim Nelson's avatar
Jim Nelson committed
422

423
cleantemps:
424 425 426
	rm -f $(EXPANDED_C_FILES)
	rm -f $(EXPANDED_OBJ_FILES)
	rm -f $(VALA_STAMP)
427
	rm -f $(LANG_STAMP)
428 429
	rm -f $(TEMPORARY_DESKTOP_FILES)
	@$(MAKE) --directory=plugins cleantemps
430

431 432
package:
	$(MAKE) dist
433
	cp $(DIST_TAR_GZ) $(PACKAGE_ORIG_GZ)
434
	rm -f $(DIST_TAR_GZ)
Jim Nelson's avatar
Jim Nelson committed
435 436
	rm -f $(DIST_TAR_BZ2)

437 438 439 440 441 442 443 444 445
dist: $(DIST_FILES)
	mkdir -p $(PROGRAM)-$(VERSION)
	cp --parents $(DIST_FILES) $(PROGRAM)-$(VERSION)
	tar --bzip2 -cvf $(DIST_TAR_BZ2) $(PROGRAM)-$(VERSION)
	tar --gzip -cvf $(DIST_TAR_GZ) $(PROGRAM)-$(VERSION)
	rm -rf $(PROGRAM)-$(VERSION)

distclean: clean
	rm -f configure.mk
446
	@$(MAKE) --directory=plugins distclean
447

448
.PHONY: install
449
install:
450 451 452
	cp misc/shotwell.desktop.head misc/shotwell.desktop
	cp misc/shotwell-viewer.desktop.head misc/shotwell-viewer.desktop
	$(foreach lang,$(SUPPORTED_LANGUAGES), echo Name[$(lang)]=`TEXTDOMAINDIR=locale-langpack \
453 454 455 456 457 458 459 460 461 462
		LANGUAGE=$(lang) gettext --domain=shotwell $(DESKTOP_APPLICATION_NAME)` \
		>> misc/shotwell.desktop ; \
		echo GenericName[$(lang)]=`TEXTDOMAINDIR=locale-langpack LANGUAGE=$(lang) \
		gettext --domain=shotwell $(DESKTOP_APPLICATION_CLASS)` >> misc/shotwell.desktop ; \
		echo Comment[$(lang)]=`TEXTDOMAINDIR=locale-langpack LANGUAGE=$(lang) gettext \
		--domain=shotwell $(DESKTOP_APPLICATION_COMMENT)` >> misc/shotwell.desktop ; \
		echo Name[$(lang)]=`TEXTDOMAINDIR=locale-langpack LANGUAGE=$(lang) gettext \
		--domain=shotwell $(DIRECT_EDIT_DESKTOP_APPLICATION_NAME)` >> misc/shotwell-viewer.desktop ; \
		echo GenericName[$(lang)]=`TEXTDOMAINDIR=locale-langpack LANGUAGE=$(lang) gettext \
		--domain=shotwell $(DIRECT_EDIT_DESKTOP_APPLICATION_CLASS)` >> misc/shotwell-viewer.desktop ;)
463
	touch $(LANG_STAMP)
464
	mkdir -p $(DESTDIR)$(PREFIX)/bin
Adam Dingle's avatar
Adam Dingle committed
465
	$(INSTALL_PROGRAM) $(PROGRAM) $(DESTDIR)$(PREFIX)/bin
466 467
	mkdir -p $(DESTDIR)$(PREFIX)/share/shotwell/icons
	$(INSTALL_DATA) icons/* $(DESTDIR)$(PREFIX)/share/shotwell/icons
Jim Nelson's avatar
Jim Nelson committed
468 469
	mkdir -p $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps
	$(INSTALL_DATA) icons/shotwell.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps
470
	mkdir -p $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps
471
	$(INSTALL_DATA) icons/shotwell-16.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/shotwell.svg
472
	mkdir -p $(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/apps
473
	$(INSTALL_DATA) icons/shotwell-24.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/apps/shotwell.svg
474
ifndef DISABLE_ICON_UPDATE
475
	-gtk-update-icon-cache -t -f $(DESTDIR)$(PREFIX)/share/icons/hicolor || :
476
endif
477 478
	mkdir -p $(DESTDIR)$(PREFIX)/share/shotwell/ui
	$(INSTALL_DATA) ui/* $(DESTDIR)$(PREFIX)/share/shotwell/ui
Jim Nelson's avatar
Jim Nelson committed
479 480 481
	mkdir -p $(DESTDIR)$(PREFIX)/share/applications
	$(INSTALL_DATA) misc/shotwell.desktop $(DESTDIR)$(PREFIX)/share/applications
	$(INSTALL_DATA) misc/shotwell-viewer.desktop $(DESTDIR)$(PREFIX)/share/applications
482
ifndef DISABLE_DESKTOP_UPDATE
483 484
	-update-desktop-database || :
endif
485
ifndef DISABLE_SCHEMAS_INSTALL
486
	GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` gconftool-2 --makefile-install-rule misc/shotwell.schemas
Jim Nelson's avatar
Jim Nelson committed
487
else
488 489
	mkdir -p $(DESTDIR)$(SCHEMA_FILE_DIR)
	$(INSTALL_DATA) misc/shotwell.schemas $(DESTDIR)$(SCHEMA_FILE_DIR)
490
endif
491 492 493 494
ifdef ENABLE_APPORT_HOOK_INSTALL
	mkdir -p $(DESTDIR)$(PREFIX)/share/apport/package-hooks
	$(INSTALL_DATA) apport/shotwell.py $(DESTDIR)$(PREFIX)/share/apport/package-hooks
endif
495
ifndef DISABLE_HELP_INSTALL
496 497 498 499
	mkdir -p $(DESTDIR)$(PREFIX)/share/gnome/help/shotwell/C
	$(INSTALL_DATA) $(EXPANDED_HELP_FILES) $(DESTDIR)$(PREFIX)/share/gnome/help/shotwell/C
	mkdir -p $(DESTDIR)$(PREFIX)/share/gnome/help/shotwell/C/figures
	$(INSTALL_DATA) $(EXPANDED_HELP_IMAGES) $(DESTDIR)$(PREFIX)/share/gnome/help/shotwell/C/figures
500
endif
Jim Nelson's avatar
Jim Nelson committed
501
	-$(foreach lang,$(SUPPORTED_LANGUAGES),`mkdir -p $(SYSTEM_LANG_DIR)/$(lang)/LC_MESSAGES ; \
502 503
		$(INSTALL_DATA) $(LOCAL_LANG_DIR)/$(lang)/LC_MESSAGES/shotwell.mo \
		$(SYSTEM_LANG_DIR)/$(lang)/LC_MESSAGES/shotwell.mo`)
504 505
	mkdir -p $(DESTDIR)$(PREFIX)/lib/shotwell/plugins/builtin
	$(INSTALL_PROGRAM) $(PLUGINS_SO) $(DESTDIR)$(PREFIX)/lib/shotwell/plugins/builtin
506 507

uninstall:
Adam Dingle's avatar
Adam Dingle committed
508
	rm -f $(DESTDIR)$(PREFIX)/bin/$(PROGRAM)
509
	rm -fr $(DESTDIR)$(PREFIX)/share/shotwell
510 511 512
	rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/shotwell.svg
	rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/shotwell.svg
	rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/apps/shotwell.svg
Jim Nelson's avatar
Jim Nelson committed
513 514
	rm -f $(DESTDIR)$(PREFIX)/share/applications/shotwell.desktop
	rm -f $(DESTDIR)$(PREFIX)/share/applications/shotwell-viewer.desktop
515
ifndef DISABLE_DESKTOP_UPDATE
516 517
	-update-desktop-database || :
endif
518
ifndef DISABLE_HELP_INSTALL
519
	rm -rf $(DESTDIR)$(PREFIX)/share/gnome/help/shotwell
520
endif
521
ifndef DISABLE_SCHEMAS_INSTALL
522
	GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` gconftool-2 --makefile-uninstall-rule misc/shotwell.schemas
Jim Nelson's avatar
Jim Nelson committed
523
else
524
	rm -f $(DESTDIR)$(SCHEMA_FILE_DIR)/shotwell.schemas
525
endif
526 527
ifdef ENABLE_APPORT_HOOK_INSTALL
	rm -f $(DESTDIR)$(PREFIX)/share/apport/package-hooks/shotwell.py
528
endif
529
	$(foreach lang,$(SUPPORTED_LANGUAGES),`rm -f $(SYSTEM_LANG_DIR)/$(lang)/LC_MESSAGES/shotwell.mo`)
530
	rm -rf $(DESTDIR)$(PREFIX)/lib/shotwell/plugins/builtin
Jim Nelson's avatar
Jim Nelson committed
531

532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549
$(BUILD_DIR):
	@mkdir -p $(BUILD_DIR)

$(UNITIZE_DIR):
	@mkdir -p $(UNITIZE_DIR)

$(UNITIZE_STAMP): $(UNITIZE_DIR) $(MAKE_FILES) src/unit/rc/UnitInternals.m4 src/unit/rc/unitize_entry.m4
	@$(foreach group,$(APP_GROUPS),\
		`m4 '--define=_APP_GROUP_=$(group)' '--define=_UNIT_ENTRY_POINTS_=$(foreach nm,$(UNIT_NAMESPACES),$(nm).init_entry,)' '--define=_UNIT_TERMINATE_POINTS_=$(foreach nm,$(UNIT_NAMESPACES),$(nm).terminate_entry,)' src/unit/rc/unitize_entry.m4 > $(UNITIZE_DIR)/_$(group)_unitize_entry.vala`)
	@$(foreach nm,$(UNIT_NAMESPACES),\
		`m4 '--define=_UNIT_NAME_=$(nm)' '--define=_UNIT_USES_INITS_=$($(nm)_USES_INITS)' '--define=_UNIT_USES_TERMINATORS_=$($(nm)_USES_TERMINATORS)' src/unit/rc/UnitInternals.m4 > $(UNITIZE_DIR)/_$(nm)Internals.vala`)
	@touch $@

$(UNITIZE_INITS) $(UNITIZE_ENTRIES): $(UNITIZE_STAMP)
	@

# EXPANDED_SRC_FILES includes UNITIZE_INITS and UNITIZE_ENTRY
$(VALA_STAMP): $(EXPANDED_SRC_FILES) $(EXPANDED_VAPI_FILES) $(EXPANDED_SRC_HEADER_FILES)
550
	@ ./minver `$(VALAC) --version | awk '{print $$2}'` $(MIN_VALAC_VERSION) || ( echo 'Shotwell requires Vala compiler $(MIN_VALAC_VERSION) or greater.  You are running' `$(VALAC) --version` '\b.'; exit 1 )
551 552
ifndef ASSUME_PKGS
ifdef EXT_PKG_VERSIONS
553
	@pkg-config --print-errors --exists '$(EXT_PKG_VERSIONS) $(DIRECT_LIBS_VERSIONS)'
554
else ifdef EXT_PKGS
555
	@pkg-config --print-errors --exists $(EXT_PKGS) $(DIRECT_LIBS_VERSIONS)
556
endif
557
# Check for libraw manually
558
	@$(LIBRAW_CONFIG) --exists=$(LIBRAW_VERSION)
559
endif
560
	@ type msgfmt > /dev/null || ( echo 'msgfmt (usually found in the gettext package) is missing and is required to build Shotwell. ' ; exit 1 )
561 562 563 564 565 566
	@echo Compiling Vala code...
	@$(VALAC) --ccode --directory=$(BUILD_DIR) --basedir=src $(VALAFLAGS) \
		$(foreach pkg,$(VALA_PKGS),--pkg=$(pkg)) \
		$(foreach vapidir,$(VAPI_DIRS),--vapidir=$(vapidir)) \
		$(foreach def,$(DEFINES),-X -D$(def)) \
		$(foreach hdir,$(HEADER_DIRS),-X -I$(hdir)) \
567
		$(VALAFLAGS) \
568 569
		$(EXPANDED_SRC_FILES)
	@touch $@
570

Jim Nelson's avatar
Jim Nelson committed
571
# Do not remove hard tab or at symbol; necessary for dependencies to complete.
572 573
$(EXPANDED_C_FILES): $(VALA_STAMP)
	@
574

575
$(EXPANDED_OBJ_FILES): %.o: %.c $(CONFIG_IN) Makefile
576
	$(CC) -c $(VALA_CFLAGS) `$(LIBRAW_CONFIG) --cflags` $(CFLAGS) -o $@ $<
Jim Nelson's avatar
Jim Nelson committed
577

578
$(PROGRAM): $(EXPANDED_OBJ_FILES) $(RESOURCES) $(LANG_STAMP)
579
	$(CC) $(EXPANDED_OBJ_FILES) $(CFLAGS) $(RESOURCES) $(VALA_LDFLAGS) `$(LIBRAW_CONFIG) --libs` $(EXPORT_FLAGS) -o $@
580

581 582 583 584
$(PLUGINS_SO): $(PLUGINS_DIR)
	@

.PHONY: $(PLUGINS_DIR)
585 586
$(PLUGINS_DIR): $(PLUGIN_VAPIS) $(PLUGIN_HEADERS) $(PLUGIN_DEPS)
	@$(MAKE) --directory=$@ PLUGINS_VERSION="$(VERSION)"
587

588 589 590
glade: lib$(PROGRAM).so

lib$(PROGRAM).so: $(EXPANDED_OBJ_FILES) $(RESOURCES) $(LANG_STAMP)
591
	$(CC) $(EXPANDED_OBJ_FILES) $(CFLAGS) $(RESOURCES) $(VALA_LDFLAGS) `$(LIBRAW_CONFIG) --libs` $(EXPORT_FLAGS) -shared -o $@
592