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
|
# Other paths are relative to this.
PREFIX ?= /usr/local
# Where to install the executable.
BINPATH ?= $(PREFIX)/bin
# Where to install the icons.
# Used by icons/Makefile
export ICONPATH ?= $(PREFIX)/share/isomaster/icons
# Used by gettext and po/Makefile (translations)
# To disable installation of some .mo files edit or delete the MOFILES
# variable in po/Makefile. This is safe to do.
export LOCALEDIR ?= $(PREFIX)/share/locale
# Where to install the man page.
MYMANPATH ?= $(PREFIX)/share/man/man1
# Where to install the .desktop file
DESKTOPPATH ?= $(PREFIX)/share/applications
# The default editor for files from the image. Users can change this. I
# recommend you set it to a graphical text editor that is likely to be
# installed by default on your distribution.
DEFAULT_EDITOR ?= mousepad
# The default viewer for files from the image. I recommend you make it
# a web browser because it can display the widest range of files.
DEFAULT_VIEWER ?= firefox
# To disable i18n completely, uncomment the following line
# or define WITHOUT_NLS somewhere else.
# This option is desired in the FreeBSD ports guidelines.
#WITHOUT_NLS = 1
# This enables overwriting the original iso,
# don't uncomment it unless you are willing to risk losing data.
#CPPFLAGS += -DENABLE_SAVE_OVERWRITE
# programs used in the Makefiles:
export CC ?= gcc
export AR = ar
export RM = rm -f
export INSTALL = install
export CP = cp
export ECHO = echo
VERSION = 1.3.3
# -DDEBUG and -g only used during development
CFLAGS += -Wall -pedantic -std=gnu99 -Wundef -Wcast-align -W -Wpointer-arith -Wwrite-strings -Wno-unused-parameter `pkg-config --cflags gtk+-2.0`
ifndef WITHOUT_NLS
CFLAGS += -DENABLE_NLS
endif
CPPFLAGS += -DICONPATH=\"$(ICONPATH)\" -DLOCALEDIR=\"$(LOCALEDIR)\" -DDEFAULT_EDITOR=\"$(DEFAULT_EDITOR)\" -DDEFAULT_VIEWER=\"$(DEFAULT_VIEWER)\" -DVERSION=\"$(VERSION)\"
# the _FILE_OFFSET_BITS=64 is to enable stat() for large files on linuxish systems
CPPFLAGS += -D_FILE_OFFSET_BITS=64
OBJECTS = isomaster.o window.o browser.o fsbrowser.o isobrowser.o error.o about.o settings.o boot.o editfile.o
all: translations isomaster.desktop isomaster
isomaster: $(OBJECTS) lib iniparser
@echo 'Linking isomaster'
@$(CC) $(OBJECTS) bk/bk.a iniparser-2.17/libiniparser.a $(CFLAGS) $(CPPFLAGS) `pkg-config --libs gtk+-2.0` -o isomaster
# static pattern rule
$(OBJECTS): %.o: %.c %.h bk/bk.h Makefile
@echo 'Compiling' $<
@$(CC) $< $(CFLAGS) $(CPPFLAGS) -c -o $@
lib:
cd bk && $(MAKE)
iniparser:
cd iniparser-2.17 && $(MAKE)
translations:
ifndef WITHOUT_NLS
cd po && $(MAKE)
endif
isomaster.desktop: isomaster.desktop.src
$(CP) isomaster.desktop.src isomaster.desktop
$(ECHO) Icon=$(ICONPATH)/isomaster.png >> isomaster.desktop
clean:
cd bk && $(MAKE) clean
cd iniparser-2.17 && $(MAKE) clean
ifndef WITHOUT_NLS
cd po && $(MAKE) clean
endif
$(RM) *.o isomaster isomaster.desktop isomaster.1.gz
# for info about DESTDIR see http://www.gnu.org/prep/standards/html_node/DESTDIR.html
install: all
gzip -9 -c isomaster.1 > isomaster.1.gz
$(INSTALL) -d $(DESTDIR)$(BINPATH)
$(INSTALL) isomaster $(DESTDIR)$(BINPATH)
cd icons && $(MAKE) install
ifndef WITHOUT_NLS
cd po && $(MAKE) install
endif
$(INSTALL) -d $(DESTDIR)$(MYMANPATH)
$(INSTALL) -m 644 isomaster.1.gz $(DESTDIR)$(MYMANPATH)
$(INSTALL) -d $(DESTDIR)$(DESKTOPPATH)
$(INSTALL) -m 644 isomaster.desktop $(DESTDIR)$(DESKTOPPATH)
uninstall:
$(RM) $(DESTDIR)$(BINPATH)/isomaster
cd icons && $(MAKE) uninstall
ifndef WITHOUT_NLS
cd po && $(MAKE) uninstall
endif
$(RM) $(DESTDIR)$(MYMANPATH)/isomaster.1
$(RM) $(DESTDIR)$(DESKTOPPATH)/isomaster.desktop
|