source: trunk/Makefile.kmk @ 603

Last change on this file since 603 was 603, checked in by Gregg Young, 5 years ago

Changes to build system to get LuGBM to build when building the entire package and to build the def files from templates.

File size: 7.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#
11#include $(PATH_SUB_CURRENT)/libdjvu/Makefile.kmk
12#include $(PATH_SUB_CURRENT)/libjpeg/Makefile.kmk
13include $(PATH_SUB_CURRENT)/Lucide/Makefile.kmk
14
15#
16# WarpIn & Zip distribution
17#
18
19PATH_OUT        ?= . # be on the safe side (we do rmdir -fR of PATH_PACKING)
20PATH_PACKING = $(PATH_OUT)/dist/packing
21
22FILE_VERSION = $(subst $(SP),_,$(subst .,_,$(VERSION)$(if $(BUILD),_$(BUILD))))
23
24LUCIDE_WPI       = $(PATH_OUT)/Lucide-$(FILE_VERSION).wpi
25LUCIDE_ZIP       = $(PATH_OUT)/Lucide-$(FILE_VERSION).zip
26
27LUCIDE_WIS       = $(PATH_PACKING)/wpi/lucide.wis
28WIC              = N:\ecs\install\WARPIN\WIC.EXE
29
30LCD_DEF          = $(PATH_ROOT)/lucide/gui/lcd.def
31LUCIDE1_DEF      = $(PATH_ROOT)/lucide/gui/lucide1.def
32LUDJVU_DEF       = $(PATH_ROOT)/lucide/plugins/ludjvu/ludjvu.def
33LUDOC_DEF        = $(PATH_ROOT)/lucide/plugins/ludoc/ludoc.def
34LUJPEG_DEF       = $(PATH_ROOT)/lucide/plugins/lujpeg/lujpeg.def
35LUPOPPLER_DEF    = $(PATH_ROOT)/lucide/plugins/lupoppler/lupoppler.def
36LUGBM_DEF        = $(PATH_ROOT)/lucide/plugins/lugbm/lugbm_gcc.def
37
38OTHER_CLEAN     += $(LUCIDE_WPI) $(LUCIDE_ZIP) $(LUCIDE_WIS)
39
40#
41# Fixme PACKING fails on missing def if this is enabled
42#
43
44# OTHER_CLEAN   += $(LUDJVU_DEF) $(LUDOC_DEF) $(LUJPEG_DEF) $(LUPOPPLER_DEF) $(LCD_DEF) $(LUCIDE1_DEF)
45
46#
47# Add target to build the def files from template set/update VERSION, VERSIONDATE
48# VERSIONTIME and BUILDMACHINE in Config.kmk first. Always run kmk -B DEFINES to
49# force them to rebuild.
50#
51
52DEFINES: $(LUCIDE1_DEF) $(LCD_DEF) $(LUDJVU_DEF) $(LUDOC_DEF) $(LUJPEG_DEF) $(LUPOPPLER_DEF) $(LUGBM_DEF)
53
54$(LUCIDE1_DEF): lucide/gui/lucide1.def.tpl Config.kmk  | $$(call DIRDEP,$$(@D))
55        $(call MSG_L1,Generating $@)
56        $(QUIET)$(SED) \
57                -e "s;\\\$${VERSION};$(VERSION);g" \
58                -e "s;\\\$${VERSIONDATE};$(VERSIONDATE);g" \
59                -e "s;\\\$${VERSIONTIME};$(VERSIONTIME);g" \
60                -e "s;\\\$${BUILDMACHINE};$(BUILDMACHINE);g" \
61                --output $@  $<
62               
63$(LCD_DEF): lucide/gui/lcd.def.tpl Config.kmk | $$(call DIRDEP,$$(@D))
64        $(call MSG_L1,Generating $@)
65        $(QUIET)$(SED) \
66                -e "s;\\\$${VERSION};$(VERSION);g" \
67                -e "s;\\\$${VERSIONDATE};$(VERSIONDATE);g" \
68                -e "s;\\\$${VERSIONTIME};$(VERSIONTIME);g" \
69                -e "s;\\\$${BUILDMACHINE};$(BUILDMACHINE);g" \
70                --output $@  $<   
71               
72$(LUDJVU_DEF): Lucide/plugins/ludjvu/ludjvu.def.tpl Config.kmk | $$(call DIRDEP,$$(@D))
73        $(call MSG_L1,Generating $@)
74        $(QUIET)$(SED) \
75                -e "s;\\\$${VERSION};$(VERSION);g" \
76                -e "s;\\\$${VERSIONDATE};$(VERSIONDATE);g" \
77                -e "s;\\\$${VERSIONTIME};$(VERSIONTIME);g" \
78                -e "s;\\\$${BUILDMACHINE};$(BUILDMACHINE);g" \
79                --output $@  $<   
80$(LUDOC_DEF):  Lucide/plugins/ludoc/ludoc.def.tpl Config.kmk | $$(call DIRDEP,$$(@D))
81        $(call MSG_L1,Generating $@)
82        $(QUIET)$(SED) \
83                -e "s;\\\$${VERSION};$(VERSION);g" \
84                -e "s;\\\$${VERSIONDATE};$(VERSIONDATE);g" \
85                -e "s;\\\$${VERSIONTIME};$(VERSIONTIME);g" \
86                -e "s;\\\$${BUILDMACHINE};$(BUILDMACHINE);g" \
87                --output $@  $<   
88$(LUJPEG_DEF): Lucide/plugins/lujpeg/lujpeg.def.tpl  Config.kmk | $$(call DIRDEP,$$(@D))
89        $(call MSG_L1,Generating $@)
90        $(QUIET)$(SED) \
91                -e "s;\\\$${VERSION};$(VERSION);g" \
92                -e "s;\\\$${VERSIONDATE};$(VERSIONDATE);g" \
93                -e "s;\\\$${VERSIONTIME};$(VERSIONTIME);g" \
94                -e "s;\\\$${BUILDMACHINE};$(BUILDMACHINE);g" \
95                --output $@  $<   
96$(LUPOPPLER_DEF): Lucide/plugins/lupoppler/lupoppler.def.tpl Config.kmk | $$(call DIRDEP,$$(@D))
97        $(call MSG_L1,Generating $@)
98        $(QUIET)$(SED) \
99                -e "s;\\\$${VERSION};$(VERSION);g" \
100                -e "s;\\\$${VERSIONDATE};$(VERSIONDATE);g" \
101                -e "s;\\\$${VERSIONTIME};$(VERSIONTIME);g" \
102                -e "s;\\\$${BUILDMACHINE};$(BUILDMACHINE);g" \
103                --output $@  $<   
104$(LUGBM_DEF): Lucide/plugins/lugbm/lugbm.def.tpl Config.kmk | $$(call DIRDEP,$$(@D))
105        $(call MSG_L1,Generating $@)
106        $(QUIET)$(SED) \
107                -e "s;\\\$${GBMVERSION};$(GBMVERSION);g" \
108                -e "s;\\\$${VERSIONDATE};$(VERSIONDATE);g" \
109                -e "s;\\\$${VERSIONTIME};$(VERSIONTIME);g" \
110                -e "s;\\\$${BUILDMACHINE};$(BUILDMACHINE);g" \
111                --output $@  $<   
112
113ifeq ($(IN_PACKING),)
114
115#
116# Special packing target sets a magic variable and restarts
117# (to avoid extra INSTALLS targets during regular non-packing kmk invocations)
118#
119PACKING          = do_packing
120
121PACKING:
122        $(RM) -fR $(PATH_PACKING)
123        $(QUIET)$(MAKE) IN_PACKING=1 uninstall rebuild packing
124
125fastpacking:
126        $(RM) -fR $(PATH_PACKING)
127        $(QUIET)$(MAKE) IN_PACKING=1 uninstall packing
128
129fastestpacking:
130        $(QUIET)$(MAKE) IN_PACKING=1 packing
131
132else
133
134#
135# Real packing rules
136#
137INSTALLS         = Lucide_wpi_1 Lucide_wpi_2 Lucide_wpi_3 Lucide_wpi_4 Lucide_wpi_5 \
138                   Lucide_wpi_6 Lucide_wpi_7 Lucide_wpi_8 Lucide_wpi_9 Lucide_wpi_10 \
139                   Lucide_zip
140PACKING          = $(LUCIDE_WPI) $(LUCIDE_ZIP)
141
142#
143# WPI
144#
145
146Lucide_wpi_1_INST                = $(notdir $(PATH_PACKING))/wpi/1/
147Lucide_wpi_1_SOURCES     = \
148        $(Lucide_1_TARGET) \
149        $(Lucide_dll_1_TARGET) \
150        $(ludoc_1_TARGET) \
151        $(abspathex $(Lucide_doc_SOURCES),$(Lucide_doc_DEFPATH)) \
152        $(abspathex $(Lucide_lng_SOURCES),$(Lucide_lng_DEFPATH))
153
154Lucide_wpi_2_INST                = $(notdir $(PATH_PACKING))/wpi/2/
155Lucide_wpi_2_SOURCES     = $(lupoppler_1_TARGET)
156
157Lucide_wpi_3_INST                = $(notdir $(PATH_PACKING))/wpi/3/
158Lucide_wpi_3_SOURCES     = $(ludjvu_1_TARGET)
159
160Lucide_wpi_4_INST                = $(notdir $(PATH_PACKING))/wpi/4/
161Lucide_wpi_4_SOURCES     = $(lujpeg_1_TARGET)
162
163Lucide_wpi_5_INST                = $(notdir $(PATH_PACKING))/wpi/5/
164Lucide_wpi_5_SOURCES     = warpin/LngDummy.txt
165
166Lucide_wpi_6_INST                = $(notdir $(PATH_PACKING))/wpi/6/
167Lucide_wpi_6_SOURCES     = warpin/LngDummy.txt
168
169Lucide_wpi_7_INST                = $(notdir $(PATH_PACKING))/wpi/7/
170Lucide_wpi_7_SOURCES     = warpin/LngDummy.txt
171
172Lucide_wpi_8_INST                = $(notdir $(PATH_PACKING))/wpi/8/
173Lucide_wpi_8_SOURCES     = warpin/LngDummy.txt
174
175Lucide_wpi_9_INST                = $(notdir $(PATH_PACKING))/wpi/9/
176Lucide_wpi_9_SOURCES     = warpin/LngDummy.txt
177
178Lucide_wpi_10_INST               = $(notdir $(PATH_PACKING))/wpi/10/
179Lucide_wpi_10_SOURCES    = warpin/LngDummy.txt
180
181
182$(LUCIDE_WPI): $(LUCIDE_WIS) install
183        $(call MSG_L1,Packing $@)
184        $(QUIET)$(RM) -f $@
185        $(QUIET)echo > $(abspathex $(Lucide_wpi_1_INST),$(PATH_OUT)/dist)/lucide.fcf
186        $(QUIET)$(WIC) -a $@ \
187                $(foreach p,$(patsubst Lucide_wpi_%,%,$(filter Lucide_wpi_%,$(INSTALLS))),\
188                        $(p) -c$(abspathex $(Lucide_wpi_$(p)_INST),$(PATH_OUT)/dist) \*) \
189                -s $(LUCIDE_WIS) -v
190
191$(LUCIDE_WIS): warpin/lucide.wis.tpl Config.kmk | $$(call DIRDEP,$$(@D))
192        $(call MSG_L1,Generating $@)
193        $(QUIET)$(SED) \
194                -e "s;\\\$${VERSION};$(VERSION);g" \
195                -e "s;\\\$${BUILD};$(BUILD);g" \
196                -e "s;\\\$${WPIVERSION};$(subst .,\\\,$(VERSION));g" \
197                -e "s;\\\$${WPIBUILD};$(WPIBUILD);g" \
198                --output $@ $<
199
200BLDDIRS += $(dir $(LUCIDE_WIS))
201
202#
203# ZIP (puts all WPI packages together)
204#
205
206Lucide_zip_INST          = $(notdir $(PATH_PACKING))/zip/
207Lucide_zip_SOURCES       = \
208        $(foreach p,$(patsubst Lucide_wpi_%,%,$(filter Lucide_wpi_%,$(INSTALLS))),\
209                $(Lucide_wpi_$(p)_SOURCES))
210
211$(LUCIDE_ZIP): install
212        $(call MSG_L1,Packing $@)
213        -$(QUIET)$(RM) -f $@
214        $(QUIET)$(REDIRECT) -C $(PATH_PACKING)/zip -- zip -Sr9 $@ \*
215
216endif # IN_PACKING
217
218include $(FILE_KBUILD_SUB_FOOTER)
219
220
Note: See TracBrowser for help on using the repository browser.