Subversion Repositories Kolibri OS

Rev

Rev 3227 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3227 Rev 3237
Line 7... Line 7...
7
BUILD_DIR:=build
7
BUILD_DIR:=build
8
REPOSITORY:=../..
8
REPOSITORY:=../..
9
KERNEL:=$(REPOSITORY)/kernel/trunk
9
KERNEL:=$(REPOSITORY)/kernel/trunk
10
PROGS:=$(REPOSITORY)/programs
10
PROGS:=$(REPOSITORY)/programs
Line 11... Line 11...
11
 
11
 
12
# The main goal: build kolibri.img and kolibri.iso
12
# The main goal: build kolibri.img, kolibri.iso and list for creating a distribution kit
Line 13... Line 13...
13
all: $(BUILD_DIR)/kolibri.img $(BUILD_DIR)/kolibri.iso
13
all: $(BUILD_DIR)/kolibri.img $(BUILD_DIR)/kolibri.iso $(BUILD_DIR)/distr.lst
14
 
14
 
15
# Docpak requires some documents; we place them
15
# Docpak requires some documents; we place them
16
# into 'docs' subdir and communicate with FASM
16
# into 'docs' subdir and communicate with FASM
Line 300... Line 300...
300
# Generate skins list understandable by gnu make
300
# Generate skins list understandable by gnu make
301
Makefile.skins: $(REPOSITORY)/skins/authors.txt $(REPOSITORY)/data/generate_makefile_skins.sh
301
Makefile.skins: $(REPOSITORY)/skins/authors.txt $(REPOSITORY)/data/generate_makefile_skins.sh
302
	cut -f1 $< | $(SHELL) $(REPOSITORY)/data/generate_makefile_skins.sh > $@
302
	cut -f1 $< | $(SHELL) $(REPOSITORY)/data/generate_makefile_skins.sh > $@
303
include Makefile.skins
303
include Makefile.skins
Line 304... Line 304...
304
 
304
 
305
# Extra targets for LiveCD image in the syntax of mkisofs
305
# Extra targets for the distribution kit and LiveCD image in the syntax of mkisofs
306
MKISOFS_EXTRA:=\
306
EXTRA:=\
307
 emu/e80/e80=e80 \
307
 emu/e80/e80=e80 \
308
 emu/dosbox/=$(PROGS)/emulator/DosBox/dosbox \
308
 emu/dosbox/=$(PROGS)/emulator/DosBox/dosbox \
309
 emu/dosbox/=$(PROGS)/emulator/DosBox/dosbox.conf \
309
 emu/dosbox/=$(PROGS)/emulator/DosBox/dosbox.conf \
310
 emu/dosbox/=$(PROGS)/emulator/DosBox/readme.txt \
310
 emu/dosbox/=$(PROGS)/emulator/DosBox/readme.txt \
311
 /=distr_data/autorun.inf \
311
 /=distr_data/autorun.inf \
312
 /=distr_data/KolibriOS_icon.ico \
-
 
313
 /=distr_data/readme.txt \
312
 /=distr_data/KolibriOS_icon.ico \
314
 Skins/=$(REPOSITORY)/skins/authors.txt \
313
 Skins/=$(REPOSITORY)/skins/authors.txt \
315
 Docs/config.txt=docs/CONFIG.TXT \
314
 Docs/config.txt=docs/CONFIG.TXT \
316
 Docs/copying.txt=docs/COPYING.TXT \
315
 Docs/copying.txt=docs/COPYING.TXT \
317
 Docs/hot_keys.txt=docs/HOT_KEYS.TXT \
316
 Docs/hot_keys.txt=docs/HOT_KEYS.TXT \
Line 345... Line 344...
345
 HD_Load/USB_boot_old/enable.exe=distr_data/enable_for_usb_boot_old.exe \
344
 HD_Load/USB_boot_old/enable.exe=distr_data/enable_for_usb_boot_old.exe \
346
 games/=../common/games \
345
 games/=../common/games \
347
 games/fara=games/fara \
346
 games/fara=games/fara \
348
 games/soko/soko=games/soko \
347
 games/soko/soko=games/soko \
349
#end of list
348
#end of list
-
 
349
DISTRIBUTION_EXTRA:=\
-
 
350
 $(EXTRA) \
-
 
351
 /readme.txt=distr_data/readme_distr.txt \
-
 
352
#end of list
-
 
353
MKISOFS_EXTRA:=\
-
 
354
 $(EXTRA) \
-
 
355
 /=distr_data/readme.txt \
-
 
356
#end of list
Line 350... Line 357...
350
 
357
 
351
# Some macro for convenient work.
358
# Some macro for convenient work.
352
# Macros for replacing '|' to escaped space '\ '.
359
# Macros for replacing '|' to escaped space '\ '.
353
space:=\ #plus space
360
space:=\ #plus space
Line 388... Line 395...
388
 
395
 
389
 
396
 
Line 390... Line 397...
390
endef
397
endef
391
mcopy_all_items:=$(foreach f,$(targets_full),$(mcopy_item_command)$(newline))
398
mcopy_all_items:=$(foreach f,$(targets_full),$(mcopy_item_command)$(newline))
-
 
399
 
-
 
400
# add skins to MKISOFS_EXTRA and DISTRIBUTION_EXTRA
392
 
401
allskins:=$(foreach f,$(SKIN_SOURCES),$(call imagepart,$(f))=$(call binarypart,$(f)))
393
# add skins to MKISOFS_EXTRA
402
MKISOFS_EXTRA:=$(MKISOFS_EXTRA) $(allskins)
394
MKISOFS_EXTRA:=$(MKISOFS_EXTRA) $(foreach f,$(SKIN_SOURCES),$(call imagepart,$(f))=$(call binarypart,$(f)))
403
DISTRIBUTION_EXTRA:=$(DISTRIBUTION_EXTRA) $(allskins)
-
 
404
# dependencies of MKISOFS_EXTRA; we iterate through $(MKISOFS_EXTRA),
-
 
405
# substitute "=" with space, get the 2nd word and join all results
-
 
406
mkisofs_extra_targets:=$(call respace,$(foreach f,$(MKISOFS_EXTRA),$(word 2,$(subst =, ,$(f)))))
-
 
407
distribution_extra_targets:=$(call respace,$(foreach f,$(DISTRIBUTION_EXTRA),$(word 2,$(subst =, ,$(f)))))
-
 
408
 
-
 
409
# Define a command for creating a symlink for an item in DISTRIBUTION_EXTRA.
-
 
410
makelink_item_command=ln -sr $(word 2,$(subst =, ,$(f))) distribution_kit/$(word 1,$(subst =, ,$(f)))
-
 
411
# Join all $(makelink_command) for all items from DISTRIBUTION_EXTRA.
-
 
412
make_distribution_links:=$(foreach f,$(DISTRIBUTION_EXTRA),$(makelink_item_command)$(newline))
-
 
413
# Define a command for creating all directories for DISTRIBUTION_EXTRA.
Line 395... Line 414...
395
# dependencies of MKISOFS_EXTRA; we iterate through $(MKISOFS_EXTRA),
414
# Note that $(sort) removes duplicate entries.
396
# substitute "=" with space, get the 2nd word and join all results
415
distribution_dirs:=$(sort $(foreach f,$(DISTRIBUTION_EXTRA),$(dir distribution_kit/$(word 1,$(subst =, ,$(f))))))
397
mkisofs_extra_targets:=$(call respace,$(foreach f,$(MKISOFS_EXTRA),$(word 2,$(subst =, ,$(f)))))
416
make_distribution_dirs:=$(foreach f,$(distribution_dirs),mkdir -p $(f)$(newline))
398
 
417
 
Line 425... Line 444...
425
$(BUILD_DIR)/kolibri.iso: $(BUILD_DIR)/kolibri.img $(mkisofs_extra_targets)
444
$(BUILD_DIR)/kolibri.iso: $(BUILD_DIR)/kolibri.img $(mkisofs_extra_targets)
426
	mkisofs -U -J -pad -b kolibri.img -c boot.catalog -hide-joliet boot.catalog -graft-points \
445
	mkisofs -U -J -pad -b kolibri.img -c boot.catalog -hide-joliet boot.catalog -graft-points \
427
	-A "KolibriOS AutoBuilder" -p "CleverMouse" -publisher "KolibriOS Team" -V "KolibriOS r$(REV)" -sysid "KOLIBRI" \
446
	-A "KolibriOS AutoBuilder" -p "CleverMouse" -publisher "KolibriOS Team" -V "KolibriOS r$(REV)" -sysid "KOLIBRI" \
428
	-iso-level 3 -o $(BUILD_DIR)/kolibri.iso $(BUILD_DIR)/kolibri.img $(call respace,$(MKISOFS_EXTRA)) 2>&1
447
	-iso-level 3 -o $(BUILD_DIR)/kolibri.iso $(BUILD_DIR)/kolibri.img $(call respace,$(MKISOFS_EXTRA)) 2>&1
Line -... Line 448...
-
 
448
 
-
 
449
# The third goal: distribution list.
-
 
450
$(BUILD_DIR)/distr.lst: $(BUILD_DIR)/kolibri.img $(distribution_extra_targets)
-
 
451
	rm -rf distribution_kit
-
 
452
	$(call respace,$(make_distribution_dirs))
-
 
453
	ln -sr $(BUILD_DIR)/kolibri.img distribution_kit/kolibri.img
-
 
454
	$(call respace,$(make_distribution_links))
429
 
455
 
430
# Special targets to modify behaviour of make.
456
# Special targets to modify behaviour of make.
431
.DELETE_ON_ERROR:
457
.DELETE_ON_ERROR:
Line 432... Line 458...
432
.SUFFIXES: # delete all predefined rules
458
.SUFFIXES: # delete all predefined rules