source: trunk/Makefile.kmk @ 468

Last change on this file since 468 was 442, checked in by dmik, 11 years ago

WPI: Added human readable version and build to the first page.

File size: 3.0 KB
Line 
1## @file
2# Top-Level Makefile
3#
4
5SUB_DEPTH = .
6include $(KBUILD_PATH)/subheader.kmk
7
8#
9# Include sub-makefiles
10#
11include $(PATH_SUB_CURRENT)/poppler/Makefile.kmk
12include $(PATH_SUB_CURRENT)/libdjvu/Makefile.kmk
13include $(PATH_SUB_CURRENT)/libjpeg/Makefile.kmk
14include $(PATH_SUB_CURRENT)/Lucide/Makefile.kmk
15
16#
17# WarpIn & Zip distribution
18#
19
20PATH_OUT        ?= . # be on the safe side (we do rmdir -fR of PATH_PACKING)
21PATH_PACKING = $(PATH_OUT)/packing
22
23FILE_VERSION = $(subst $(SP),_,$(subst .,_,$(VERSION)$(if $(BUILD),_$(BUILD))))
24
25LUCIDE_WPI       = $(PATH_OUT)/Lucide-$(FILE_VERSION).wpi
26LUCIDE_ZIP       = $(PATH_OUT)/Lucide-$(FILE_VERSION).zip
27
28LUCIDE_WIS       = $(PATH_PACKING)/wpi/lucide.wis
29
30OTHER_CLEAN     += $(LUCIDE_WPI) $(LUCIDE_ZIP) $(LUCIDE_WIS)
31
32ifeq ($(IN_PACKING),)
33
34#
35# Special packing target sets a magic variable and restarts
36# (to avoid extra INSTALLS targets during regular non-packing kmk invocations)
37#
38PACKING          = do_packing
39
40do_packing:
41        $(RM) -fR $(PATH_PACKING)
42        $(QUIET)$(MAKE) IN_PACKING=1 uninstall rebuild packing
43
44fastpacking:
45        $(RM) -fR $(PATH_PACKING)
46        $(QUIET)$(MAKE) IN_PACKING=1 uninstall packing
47
48fastestpacking:
49        $(QUIET)$(MAKE) IN_PACKING=1 packing
50
51else
52
53#
54# Real packing rules
55#
56INSTALLS         = Lucide_wpi_1 Lucide_wpi_2 Lucide_wpi_3 Lucide_wpi_4 Lucide_zip
57PACKING          = $(LUCIDE_WPI) $(LUCIDE_ZIP)
58
59#
60# WPI
61#
62
63Lucide_wpi_1_INST                = $(notdir $(PATH_PACKING))/wpi/1
64Lucide_wpi_1_SOURCES     = \
65        $(TARGET_Lucide) \
66        $(TARGET_Lucide_dll) \
67        $(TARGET_ludoc) \
68        $(abspathex $(Lucide_doc_SOURCES),$(Lucide_doc_PATH)) \
69        $(abspathex $(Lucide_lng_SOURCES),$(Lucide_lng_PATH))
70
71Lucide_wpi_2_INST                = $(notdir $(PATH_PACKING))/wpi/2
72Lucide_wpi_2_SOURCES     = $(TARGET_lupoppler)
73
74Lucide_wpi_3_INST                = $(notdir $(PATH_PACKING))/wpi/3
75Lucide_wpi_3_SOURCES     = $(TARGET_ludjvu)
76
77Lucide_wpi_4_INST                = $(notdir $(PATH_PACKING))/wpi/4
78Lucide_wpi_4_SOURCES     = $(TARGET_lujpeg)
79
80$(LUCIDE_WPI): $(LUCIDE_WIS) install
81        $(call MSG_L1,Packing $@)
82        -$(QUIET)$(RM) -f $@
83        $(QUIET)echo > $(abspathex $(Lucide_wpi_1_INST),$(PATH_OUT))/lucide.fcf
84        $(QUIET)wic -a $@ \
85                $(foreach p,$(patsubst Lucide_wpi_%,%,$(filter Lucide_wpi_%,$(INSTALLS))),\
86                        $(p) -c$(abspathex $(Lucide_wpi_$(p)_INST),$(PATH_OUT)) \*) \
87                -s $(LUCIDE_WIS)
88
89$(LUCIDE_WIS): warpin/lucide.wis.tpl Config.kmk | $$(call DIRDEP,$$(@D))
90        $(call MSG_L1,Generating $@)
91        $(QUIET)$(SED) \
92                -e "s;\\\$${VERSION};$(VERSION);g" \
93                -e "s;\\\$${BUILD};$(BUILD);g" \
94                -e "s;\\\$${WPIVERSION};$(subst .,\\\,$(VERSION));g" \
95                -e "s;\\\$${WPIBUILD};$(WPIBUILD);g" \
96                --output $@ $<
97
98BLDDIRS += $(dir $(LUCIDE_WIS))
99
100#
101# ZIP (puts all WPI packages together)
102#
103
104Lucide_zip_INST          = $(notdir $(PATH_PACKING))/zip
105Lucide_zip_SOURCES       = \
106        $(foreach p,$(patsubst Lucide_wpi_%,%,$(filter Lucide_wpi_%,$(INSTALLS))),\
107                $(Lucide_wpi_$(p)_SOURCES))
108
109$(LUCIDE_ZIP): install
110        $(call MSG_L1,Packing $@)
111        -$(QUIET)$(RM) -f $@
112        $(QUIET)$(REDIRECT) -C $(PATH_PACKING)/zip -- zip -Sr9 $@ \*
113
114endif # IN_PACKING
115
116include $(FILE_KBUILD_SUB_FOOTER)
117
Note: See TracBrowser for help on using the repository browser.