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 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256
|
# gMTP Sync tool
PKG_NAME = gmtp
PREFIX ?= /usr/local
VER = 1.3.3
# Note: If you update above, please update the config.h and pkginfo file as well.
PKG = gmtp
ARCH = i386
PKGFILE = $(PKG)-$(VER)-$(ARCH).pkg
TARFILE = $(PKG_NAME)-$(VER)-$(ARCH).tar
UNAME = $(shell uname)
# See what OS we are, and set things for Solaris, otherwise use a default
# that should work.
ifeq ($(UNAME), SunOS)
CC = cc
CFLAGS += -Xc -v -xc99 #-native -fast
SUNVERSION = $(shell uname -r)
ifeq ($(SUNVERSION), 5.11)
INSTALL = ginstall -c
MSGFMT = msgfmt --strict
else
INSTALL = /usr/ucb/install -c
MSGFMT = /usr/bin/msgfmt --strict
LDFLAGS += -L/usr/sfw/lib -R/usr/sfw/lib
endif
else
CC = gcc
CFLAGS += -std=c99 -Wall
INSTALL = install -c
MSGFMT = msgfmt
endif
GCONFTOOL = gconftool-2
TAR = tar
CFLAGS += -c -g #-O
LDFLAGS +=
LIBS +=
PKG_CONFIG ?= pkg-config
.SUFFIXES: .c .o .po .mo
ifeq ($(MAKECMDGOALS),gtk3)
PKGS = gtk+-3.0 gio-2.0
CFLAGS += -DGMTP_USE_GTK3
else
PKGS = gtk+-2.0 gconf-2.0
endif
PKGS += gthread-2.0 libmtp id3tag flac vorbisfile
GTK_CFLAGS = `$(PKG_CONFIG) --cflags $(PKGS)`
GTK_LDFLAGS = `$(PKG_CONFIG) --libs $(PKGS)`
objects = src/main.o src/mtp.o src/interface.o src/callbacks.o src/prefs.o src/dnd.o src/metatag_info.o
headers = src/main.h src/mtp.h src/interface.h src/callbacks.h src/prefs.h src/dnd.h src/metatag_info.h src/config.h
catalogues = po/es.mo po/it.mo po/fr.mo po/da.mo po/de.mo
POFILES = po/es.po po/it.po po/fr.po po/da.po po/de.po
all: gmtp $(catalogues)
# GTK3 build
gtk3: gmtp $(catalogues)
# GTK2 build
gtk2: gmtp $(catalogues)
# Main executable
gmtp: $(objects)
$(CC) -o gmtp $(LDFLAGS) $(objects) $(GTK_LDFLAGS) $(LIBS)
# Object Files
src/main.o: src/main.c $(headers)
$(CC) $(GTK_CFLAGS) $(CFLAGS) -o $@ src/main.c
src/mtp.o: src/mtp.c $(headers)
$(CC) $(GTK_CFLAGS) $(CFLAGS) -o $@ src/mtp.c
src/interface.o: src/interface.c $(headers)
$(CC) $(GTK_CFLAGS) $(CFLAGS) -o $@ src/interface.c
src/callbacks.o: src/callbacks.c $(headers)
$(CC) $(GTK_CFLAGS) $(CFLAGS) -o $@ src/callbacks.c
src/prefs.o: src/prefs.c $(headers)
$(CC) $(GTK_CFLAGS) $(CFLAGS) -o $@ src/prefs.c
src/dnd.o: src/dnd.c $(headers)
$(CC) $(GTK_CFLAGS) $(CFLAGS) -o $@ src/dnd.c
src/metatag_info.o: src/metatag_info.c $(headers)
$(CC) $(GTK_CFLAGS) $(CFLAGS) -o $@ src/metatag_info.c
# Language Files
po/es.mo: po/es.po
$(MSGFMT) -o po/es.mo po/es.po
po/it.mo: po/it.po
$(MSGFMT) -o po/it.mo po/it.po
po/de.mo: po/de.po
$(MSGFMT) -o po/de.mo po/de.po
po/da.mo: po/da.po
$(MSGFMT) -o po/da.mo po/da.po
po/fr.mo: po/fr.po
$(MSGFMT) -o po/fr.mo po/fr.po
# Installation
install: gmtp $(catalogues)
$(INSTALL) -d $(DESTDIR)$(PREFIX)
$(INSTALL) -d $(DESTDIR)$(PREFIX)/bin
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/$(PKG_NAME)
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/applications
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/pixmaps
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/gconf
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/gconf/schemas
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/locale
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/locale/es
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/locale/it
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/locale/fr
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/locale/da
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/locale/de
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/locale/es/LC_MESSAGES
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/locale/it/LC_MESSAGES
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/locale/fr/LC_MESSAGES
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/locale/da/LC_MESSAGES
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/locale/de/LC_MESSAGES
$(INSTALL) -m 755 gmtp $(DESTDIR)$(PREFIX)/bin
$(INSTALL) -m 644 images/icon.png $(DESTDIR)$(PREFIX)/share/$(PKG_NAME)
$(INSTALL) -m 644 images/logo.png $(DESTDIR)$(PREFIX)/share/$(PKG_NAME)
$(INSTALL) -m 644 images/icon-16.png $(DESTDIR)$(PREFIX)/share/$(PKG_NAME)
$(INSTALL) -m 644 images/stock-about-16.png $(DESTDIR)$(PREFIX)/share/$(PKG_NAME)
$(INSTALL) -m 644 images/audio-x-mp3-playlist.png $(DESTDIR)$(PREFIX)/share/$(PKG_NAME)
$(INSTALL) -m 644 images/audio-x-mpeg.png $(DESTDIR)$(PREFIX)/share/$(PKG_NAME)
$(INSTALL) -m 644 images/folder.png $(DESTDIR)$(PREFIX)/share/$(PKG_NAME)
$(INSTALL) -m 644 images/image-x-generic.png $(DESTDIR)$(PREFIX)/share/$(PKG_NAME)
$(INSTALL) -m 644 images/media-cdrom-audio.png $(DESTDIR)$(PREFIX)/share/$(PKG_NAME)
$(INSTALL) -m 644 images/text-plain.png $(DESTDIR)$(PREFIX)/share/$(PKG_NAME)
$(INSTALL) -m 644 images/video-x-generic.png $(DESTDIR)$(PREFIX)/share/$(PKG_NAME)
$(INSTALL) -m 644 images/empty.png $(DESTDIR)$(PREFIX)/share/$(PKG_NAME)
$(INSTALL) -m 644 images/view-refresh.png $(DESTDIR)$(PREFIX)/share/$(PKG_NAME)
$(INSTALL) -m 644 misc/gMTP.desktop $(DESTDIR)$(PREFIX)/share/applications
$(INSTALL) -m 644 images/icon.png $(DESTDIR)$(PREFIX)/share/pixmaps
$(INSTALL) -m 644 misc/gMTP.schemas $(DESTDIR)$(PREFIX)/share/gconf/schemas
mv $(DESTDIR)$(PREFIX)/share/pixmaps/icon.png $(DESTDIR)$(PREFIX)/share/pixmaps/gMTPicon.png
cp po/es.mo $(DESTDIR)$(PREFIX)/share/locale/es/LC_MESSAGES/gmtp.mo
cp po/fr.mo $(DESTDIR)$(PREFIX)/share/locale/fr/LC_MESSAGES/gmtp.mo
cp po/it.mo $(DESTDIR)$(PREFIX)/share/locale/it/LC_MESSAGES/gmtp.mo
cp po/da.mo $(DESTDIR)$(PREFIX)/share/locale/da/LC_MESSAGES/gmtp.mo
cp po/de.mo $(DESTDIR)$(PREFIX)/share/locale/de/LC_MESSAGES/gmtp.mo
mv $(DESTDIR)$(PREFIX)/share/gconf/schemas/gMTP.schemas $(DESTDIR)$(PREFIX)/share/gconf/schemas/gmtp.schemas
register-gconf-schemas: install
GCONF_CONFIG_SOURCE=`$(GCONFTOOL) --get-default-source` $(GCONFTOOL) --makefile-install-rule $(DESTDIR)$(PREFIX)/share/gconf/schemas/gmtp.schemas
install-gtk3: gmtp $(catalogues)
$(INSTALL) -d $(DESTDIR)$(PREFIX)
$(INSTALL) -d $(DESTDIR)$(PREFIX)/bin
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/$(PKG_NAME)
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/applications
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/pixmaps
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/glib-2.0
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/glib-2.0/schemas
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/locale
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/locale/es
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/locale/it
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/locale/fr
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/locale/da
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/locale/de
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/locale/es/LC_MESSAGES
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/locale/it/LC_MESSAGES
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/locale/fr/LC_MESSAGES
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/locale/da/LC_MESSAGES
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/locale/de/LC_MESSAGES
$(INSTALL) -m 755 gmtp $(DESTDIR)$(PREFIX)/bin
$(INSTALL) -m 644 images/icon.png $(DESTDIR)$(PREFIX)/share/$(PKG_NAME)
$(INSTALL) -m 644 images/icon-16.png $(DESTDIR)$(PREFIX)/share/$(PKG_NAME)
$(INSTALL) -m 644 images/logo.png $(DESTDIR)$(PREFIX)/share/$(PKG_NAME)
$(INSTALL) -m 644 images/stock-about-16.png $(DESTDIR)$(PREFIX)/share/$(PKG_NAME)
$(INSTALL) -m 644 misc/gMTP.desktop $(DESTDIR)$(PREFIX)/share/applications
$(INSTALL) -m 644 images/icon.png $(DESTDIR)$(PREFIX)/share/pixmaps
$(INSTALL) -m 644 images/audio-x-mp3-playlist.png $(DESTDIR)$(PREFIX)/share/$(PKG_NAME)
$(INSTALL) -m 644 images/audio-x-mpeg.png $(DESTDIR)$(PREFIX)/share/$(PKG_NAME)
$(INSTALL) -m 644 images/folder.png $(DESTDIR)$(PREFIX)/share/$(PKG_NAME)
$(INSTALL) -m 644 images/image-x-generic.png $(DESTDIR)$(PREFIX)/share/$(PKG_NAME)
$(INSTALL) -m 644 images/media-cdrom-audio.png $(DESTDIR)$(PREFIX)/share/$(PKG_NAME)
$(INSTALL) -m 644 images/text-plain.png $(DESTDIR)$(PREFIX)/share/$(PKG_NAME)
$(INSTALL) -m 644 images/video-x-generic.png $(DESTDIR)$(PREFIX)/share/$(PKG_NAME)
$(INSTALL) -m 644 images/empty.png $(DESTDIR)$(PREFIX)/share/$(PKG_NAME)
$(INSTALL) -m 644 images/view-refresh.png $(DESTDIR)$(PREFIX)/share/$(PKG_NAME)
mv $(DESTDIR)$(PREFIX)/share/pixmaps/icon.png $(DESTDIR)$(PREFIX)/share/pixmaps/gMTPicon.png
cp po/es.mo $(DESTDIR)$(PREFIX)/share/locale/es/LC_MESSAGES/gmtp.mo
cp po/fr.mo $(DESTDIR)$(PREFIX)/share/locale/fr/LC_MESSAGES/gmtp.mo
cp po/it.mo $(DESTDIR)$(PREFIX)/share/locale/it/LC_MESSAGES/gmtp.mo
cp po/da.mo $(DESTDIR)$(PREFIX)/share/locale/da/LC_MESSAGES/gmtp.mo
cp po/de.mo $(DESTDIR)$(PREFIX)/share/locale/de/LC_MESSAGES/gmtp.mo
register-gsettings-schemas: install-gtk3
$(INSTALL) -m 644 misc/org.gnome.gmtp.gschema.xml $(DESTDIR)$(PREFIX)/share/glib-2.0/schemas
glib-compile-schemas $(DESTDIR)$(PREFIX)/share/glib-2.0/schemas
install-doc:
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/doc
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/doc/$(PKG_NAME)
$(INSTALL) -m 644 README $(DESTDIR)$(PREFIX)/share/doc/$(PKG_NAME)
$(INSTALL) -m 644 COPYING $(DESTDIR)$(PREFIX)/share/doc/$(PKG_NAME)
$(INSTALL) -m 644 ChangeLog $(DESTDIR)$(PREFIX)/share/doc/$(PKG_NAME)
$(INSTALL) -m 644 AUTHORS $(DESTDIR)$(PREFIX)/share/doc/$(PKG_NAME)
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/gmtp
rm -f $(DESTDIR)$(PREFIX)/share/$(PKG_NAME)/*
rm -f $(DESTDIR)$(PREFIX)/share/applications/gMTP.desktop
rm -f $(DESTDIR)$(PREFIX)/share/pixmaps/gMTPicon.png
rm -f $(DESTDIR)$(PREFIX)/share/gconf/schemas/gmtp.schemas
rm -f $(DESTDIR)$(PREFIX)/share/glib-2.0/schemas/org.gnome.gMTP.gschema.xml
rm -f $(DESTDIR)$(PREFIX)/share/locale/es/LC_MESSAGES/gmtp.mo
rm -f $(DESTDIR)$(PREFIX)/share/locale/fr/LC_MESSAGES/gmtp.mo
rm -f $(DESTDIR)$(PREFIX)/share/locale/it/LC_MESSAGES/gmtp.mo
rm -f $(DESTDIR)$(PREFIX)/share/locale/da/LC_MESSAGES/gmtp.mo
rm -f $(DESTDIR)$(PREFIX)/share/locale/de/LC_MESSAGES/gmtp.mo
uninstall-doc:
rm $(DESTDIR)$(PREFIX)/share/doc/$(PKG_NAME)/README
rm $(DESTDIR)$(PREFIX)/share/doc/$(PKG_NAME)/COPYING
rm $(DESTDIR)$(PREFIX)/share/doc/$(PKG_NAME)/ChangeLog
rm $(DESTDIR)$(PREFIX)/share/doc/$(PKG_NAME)/AUTHORS
clean:
rm -f $(objects) core gmtp src/*.o src/*~ $(PKGFILE).gz po/*.mo po/*~
dist:
rm -f $(objects) core gmtp src/*.o src/*~ po/*.mo po/*~
cd .. && $(TAR) -cf $(TARFILE) gMTP && gzip $(TARFILE) && cd gMTP
pkg: gmtp $(catalogues)
pkgmk -o -d /tmp -a $(ARCH)
touch $(PKGFILE)
pkgtrans -s /tmp $(PKGFILE) $(PKG)
rm -r /tmp/$(PKG)
gzip $(PKGFILE)
|