Makefile 2.14 KB
Newer Older
1

2
TARGET = shotwell
3

4 5 6 7 8 9 10 11 12
VALAC = valac
INSTALL_PROGRAM = install
INSTALL_DATA = install -m 644

VALAFLAGS = -g --enable-checking
ifdef dev
DEVFLAGS = --save-temps
endif

13
# C99 takes care of a warning message generated by the use of Math.round in image_util.vala
14 15 16 17 18
ALL_VALAFLAGS = $(VALAFLAGS) $(DEVFLAGS) --Xcc=-std=c99

PREFIX=/usr/local
DESKTOP_DIR=/usr/share/applications
-include configure.in
19 20 21 22 23 24

SRC_FILES = \
	main.vala \
	AppWindow.vala \
	CollectionPage.vala \
	Thumbnail.vala \
25
	DatabaseTables.vala \
26
	ThumbnailCache.vala \
27
	image_util.vala \
28 29
	CollectionLayout.vala \
	PhotoPage.vala \
30
	Exif.vala \
31 32
	Page.vala \
	ImportPage.vala \
33
	GPhoto.vala \
34
	SortedList.vala \
35 36 37 38
	EventsDirectoryPage.vala \
	Dimensions.vala \
	Box.vala \
	Photo.vala \
39
	Orientation.vala \
40
	util.vala \
Jim Nelson's avatar
Jim Nelson committed
41
	BatchImport.vala \
42 43 44
	ExportDialog.vala \
	Resources.vala

45
VAPI_FILES = \
46
	libexif.vapi \
47 48
	fstream.vapi \
	libgphoto2.vapi
49

50
RESOURCE_FILES = \
51 52
	photo.ui \
	collection.ui \
53 54
	import.ui \
	fullscreen.ui
55 56 57

HEADER_FILES = \
	gphoto.h
58

59 60 61
VAPI_DIRS = \
	.

62 63
HEADER_DIRS = \
	.
64

65
LOCAL_PKGS = \
66
	libexif \
67
	fstream \
68
	libgphoto2 \
69 70 71 72 73

EXT_PKGS = \
	gtk+-2.0 \
	sqlite3 \
	vala-1.0 \
74
	hal \
75
	dbus-glib-1 \
76
	unique-1.0
77

78 79
PKGS = $(EXT_PKGS) $(LOCAL_PKGS)

80
all: $(TARGET)
Jim Nelson's avatar
Jim Nelson committed
81 82

clean:
83
	rm -f *.c
84
	rm -f $(CONFIG_IN)
85
	rm -f $(TARGET)
Jim Nelson's avatar
Jim Nelson committed
86

87 88 89
cleantemps:
	rm -f *.c

90
install: $(TARGET) shotwell.desktop
91 92 93 94 95 96
	$(INSTALL_PROGRAM) $(TARGET) $(DESTDIR)$(PREFIX)/bin
	mkdir -p $(DESTDIR)$(PREFIX)/share/shotwell/icons
	$(INSTALL_DATA) icons/* $(DESTDIR)$(PREFIX)/share/shotwell/icons
	mkdir -p $(DESTDIR)$(PREFIX)/share/shotwell/ui
	$(INSTALL_DATA) ui/* $(DESTDIR)$(PREFIX)/share/shotwell/ui
	$(INSTALL_DATA) shotwell.desktop $(DESTDIR)$(DESKTOP_DIR)
97 98

uninstall:
99 100 101
	rm -f $(DESTDIR)$(PREFIX)/bin/$(TARGET)
	rm -fr $(DESTDIR)$(PREFIX)/share/shotwell
	rm -f $(DESTDIR)$(DESKTOP_DIR)/shotwell.desktop
102

103
$(TARGET): $(SRC_FILES) $(VAPI_FILES) $(HEADER_FILES) Makefile configure $(CONFIG_IN)
104
	pkg-config --print-errors --exists $(EXT_PKGS)
105
	$(VALAC) $(ALL_VALAFLAGS) \
106 107 108
	$(foreach pkg,$(PKGS),--pkg=$(pkg)) \
	$(foreach vapidir,$(VAPI_DIRS), --vapidir=$(vapidir)) \
	$(foreach hdir,$(HEADER_DIRS),-X -I$(hdir)) \
109
	-X -DPREFIX='"$(PREFIX)"' \
110 111
	$(SRC_FILES) \
	-o $(TARGET)
Jim Nelson's avatar
Jim Nelson committed
112