FBReader 0.8.14
[lbook_fbreader.git] / fbreader / Makefile
blob9640067ec079d88a55d6e00b0087722d92a7ec30
1 ROOTDIR = $(CURDIR)/..
3 MAKEFILESDIR = $(ROOTDIR)/makefiles
5 include $(MAKEFILESDIR)/config.mk
7 TARGET = FBReader
8 target = fbreader
10 ALL_SUBDIRS = src src/migration src/options src/description src/collection src/bookmodel src/formats src/formats/fb2 src/formats/docbook src/formats/html src/formats/pdb src/formats/txt src/formats/tcr src/formats/chm src/formats/xhtml src/formats/oeb src/formats/rtf src/formats/openreader src/formats/dummy src/formats/util src/external src/optionsDialog src/fbreader src/encodingOption
11 ALL_ARCHSUBDIRS = desktop pdaxrom opie zaurus maemo openzaurus pma400 win32
13 SUBDIRS = src/migration src/options src/description src/collection src/bookmodel src/formats src/formats/fb2 src/formats/html src/formats/pdb src/formats/txt src/formats/tcr src/formats/chm src/formats/xhtml src/formats/oeb src/formats/rtf src/formats/openreader src/formats/util src/external src/optionsDialog src/fbreader src/encodingOption
15 all: .resources
16 @for subdir in $(SUBDIRS); do \
17 if ! $(MAKE) -C $$subdir -f $(MAKEFILESDIR)/subdir.mk; then \
18 exit 1; \
19 fi; \
20 done;
21 @echo -n "Linking $(TARGET) ..."
22 @$(LD) $(LDFLAGS) -o $(TARGET) `find src -name *.o` -L$(ROOTDIR)/zlibrary/text -lzltext $(CORE_LIBS)
23 @echo " OK"
25 FBSHAREDIR = $(DESTDIR)$(subst %APPLICATION_PATH%\\\\,/,$(SHAREDIR))/FBReader
26 VARIANT = $(TARGET_ARCH)
27 ifneq "$(RESOLUTION)" ""
28 VARIANT = $(TARGET_ARCH)_$(RESOLUTION)
29 endif
31 APPIMAGEDIR_REAL = $(subst \\\\,/,$(subst %APPLICATION_PATH%\\\\,/,$(subst %application_name%,$(target),$(subst %APPLICATION_NAME%,$(TARGET),$(APPIMAGEDIR)))))
33 do_install:
34 @install -d $(DESTDIR)$(BINDIR)
35 @install $(TARGET) $(DESTDIR)$(BINDIR)/FBReader
36 @install -d $(FBSHAREDIR)
37 @install -d $(FBSHAREDIR)/help
38 @./scripts/install_help.sh $(VARIANT) $(FBSHAREDIR)/help
39 @install -d $(FBSHAREDIR)/formats/html
40 @install -m 0644 data/formats/html/html.ent $(FBSHAREDIR)/formats/html
41 @install -d $(FBSHAREDIR)/formats/xhtml
42 @install -m 0644 $(wildcard data/formats/xhtml/*.ent) $(FBSHAREDIR)/formats/xhtml
43 @install -d $(FBSHAREDIR)/default
44 @./scripts/install_toolbar_and_menu.sh $(VARIANT) $(FBSHAREDIR)/default
45 @install -m 0644 data/default/external.$(TARGET_ARCH).xml $(FBSHAREDIR)/default/external.xml
46 @if [ -f data/default/messages.$(TARGET_ARCH).xml ]; then \
47 install -m 0644 data/default/messages.$(TARGET_ARCH).xml $(FBSHAREDIR)/default/messages.xml; \
49 @install -d $(FBSHAREDIR)/resources
50 @install -m 0644 $(wildcard data/resources/*.xml) $(FBSHAREDIR)/resources
51 @install -d $(DESTDIR)$(APPIMAGEDIR_REAL)
52 @install -m 0644 $(wildcard icons/toolbar/$(VARIANT)/*.*) $(DESTDIR)$(APPIMAGEDIR_REAL)
53 @install -m 0644 $(wildcard icons/filetree/$(VARIANT)/*.*) $(DESTDIR)$(APPIMAGEDIR_REAL)
54 @install -m 0644 $(wildcard icons/booktree/$(VARIANT)/*.*) $(DESTDIR)$(APPIMAGEDIR_REAL)
55 @make -C $(TARGET_ARCH) RESOLUTION=$(RESOLUTION) install
57 clean:
58 @for subdir in $(ALL_SUBDIRS); do \
59 $(MAKE) -C $$subdir -f $(MAKEFILESDIR)/subdir.mk clean; \
60 done;
61 @for subdir in $(ALL_ARCHSUBDIRS); do \
62 cd $$subdir; make clean; cd ..; \
63 done;
64 @$(RM) $(TARGET) err