forked from KolibriOS/kolibrios
Makefile: support for NASM compilation
git-svn-id: svn://kolibrios.org@1752 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
be23f55152
commit
c9b9466b37
@ -164,6 +164,13 @@ FASM_PROGRAMS:=\
|
|||||||
network/zeroconf:NETWORK/ZEROCONF:$(PROGS)/network/zeroconf/trunk/zeroconf.asm \
|
network/zeroconf:NETWORK/ZEROCONF:$(PROGS)/network/zeroconf/trunk/zeroconf.asm \
|
||||||
# end of list
|
# end of list
|
||||||
|
|
||||||
|
# The list of all NASM programs with one main NASM file.
|
||||||
|
# Format of an item is exactly the same as in the previous list.
|
||||||
|
NASM_PROGRAMS:=\
|
||||||
|
demos/aclock:DEMOS/ACLOCK:$(PROGS)/demos/aclock/trunk/aclock.asm \
|
||||||
|
games/c4:GAMES/C4:$(PROGS)/games/c4/trunk/c4.asm \
|
||||||
|
# end of list
|
||||||
|
|
||||||
# The list of files which should be copied from somewhere.
|
# The list of files which should be copied from somewhere.
|
||||||
# Format of an item is exactly the same as in the previous list.
|
# Format of an item is exactly the same as in the previous list.
|
||||||
COPY_FILES:=\
|
COPY_FILES:=\
|
||||||
@ -198,7 +205,7 @@ OTHER_FILES:=asciivju:ASCIIVJU autorun.dat:AUTORUN.DAT \
|
|||||||
vmode:VMODE \
|
vmode:VMODE \
|
||||||
3d/3dsheart:3D/3DSHEART 3d/3dspiral:3D/3DSPIRAL 3d/cubeline:3D/CUBELINE \
|
3d/3dsheart:3D/3DSHEART 3d/3dspiral:3D/3DSPIRAL 3d/cubeline:3D/CUBELINE \
|
||||||
3d/flatwav:3D/FLATWAV 3d/gears:3D/GEARS 3d/house.3ds:3D/HOUSE.3DS \
|
3d/flatwav:3D/FLATWAV 3d/gears:3D/GEARS 3d/house.3ds:3D/HOUSE.3DS \
|
||||||
demos/aclock:DEMOS/ACLOCK demos/ak47.lif:DEMOS/AK47.LIF \
|
demos/ak47.lif:DEMOS/AK47.LIF \
|
||||||
demos/barge.lif:DEMOS/BARGE.LIF demos/life2:DEMOS/LIFE2 \
|
demos/barge.lif:DEMOS/BARGE.LIF demos/life2:DEMOS/LIFE2 \
|
||||||
demos/relay.lif:DEMOS/RELAY.LIF demos/rpento.lif:DEMOS/RPENTO.LIF \
|
demos/relay.lif:DEMOS/RELAY.LIF demos/rpento.lif:DEMOS/RPENTO.LIF \
|
||||||
demos/use_mb:DEMOS/USE_MB demos/web:DEMOS/WEB \
|
demos/use_mb:DEMOS/USE_MB demos/web:DEMOS/WEB \
|
||||||
@ -214,7 +221,7 @@ OTHER_FILES:=asciivju:ASCIIVJU autorun.dat:AUTORUN.DAT \
|
|||||||
File|Managers/kfm_keys.txt:File|Managers/KFM_KEYS.TXT \
|
File|Managers/kfm_keys.txt:File|Managers/KFM_KEYS.TXT \
|
||||||
fonts/bold.chr:FONTS/BOLD.CHR fonts/char2.mt:FONTS/CHAR2.MT \
|
fonts/bold.chr:FONTS/BOLD.CHR fonts/char2.mt:FONTS/CHAR2.MT \
|
||||||
fonts/char.mt:FONTS/CHAR.MT \
|
fonts/char.mt:FONTS/CHAR.MT \
|
||||||
games/bnc:GAMES/BNC games/c4:GAMES/C4 \
|
games/bnc:GAMES/BNC \
|
||||||
games/checkers:GAMES/CHECKERS games/clicks:GAMES/CLICKS \
|
games/checkers:GAMES/CHECKERS games/clicks:GAMES/CLICKS \
|
||||||
games/FindNumbers:GAMES/FindNumbers games/gomoku:GAMES/GOMOKU \
|
games/FindNumbers:GAMES/FindNumbers games/gomoku:GAMES/GOMOKU \
|
||||||
games/klavisha:GAMES/KLAVISHA games/kosilka:GAMES/KOSILKA \
|
games/klavisha:GAMES/KLAVISHA games/kosilka:GAMES/KOSILKA \
|
||||||
|
6
data/eng/Makefile.copy
Normal file
6
data/eng/Makefile.copy
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# This is similar to Makefile.fasm, look there for comments.
|
||||||
|
define copy_meta_rule
|
||||||
|
$(1): $(2) Makefile.copy $$(call respace,$$(addsuffix .dir,$(3)))
|
||||||
|
cp $$< "$$@"
|
||||||
|
endef
|
||||||
|
$(foreach f,$(COPY_FILES),$(eval $(call copy_meta_rule,$(fbinary),$(fsource),$(binarydir))))
|
13
data/eng/Makefile.nasm
Normal file
13
data/eng/Makefile.nasm
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# This is similar to Makefile.fasm, look there for comments.
|
||||||
|
define nasm_meta_rule
|
||||||
|
.deps/$(4).Po: $(2) Makefile.nasm .deps/.dir
|
||||||
|
nasm -I$$(dir $(2)) -o "$(1)" -M $$< > .deps/$(4).Tpo 2>/dev/null; if [ $$$$? -eq 0 ]; \
|
||||||
|
then sed 's|\(.*\):|\1 .deps/$(4).Po:|' .deps/$(4).Tpo > .deps/$(4).Po; fi
|
||||||
|
rm -f .deps/$(4).Tpo
|
||||||
|
$(1): $(2) Makefile.nasm $$(call respace,$$(addsuffix .dir,$(3)))
|
||||||
|
nasm -I$$(dir $(2)) -o "$$@" $$<
|
||||||
|
kpack --nologo "$$@"
|
||||||
|
-include .deps/$(4).Po
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(foreach f,$(NASM_PROGRAMS),$(eval $(call nasm_meta_rule,$(fbinary),$(fsource),$(binarydir),$(progname))))
|
Binary file not shown.
Binary file not shown.
@ -164,6 +164,13 @@ FASM_PROGRAMS:=\
|
|||||||
network/zeroconf:NETWORK/ZEROCONF:$(PROGS)/network/zeroconf/trunk/zeroconf.asm \
|
network/zeroconf:NETWORK/ZEROCONF:$(PROGS)/network/zeroconf/trunk/zeroconf.asm \
|
||||||
# end of list
|
# end of list
|
||||||
|
|
||||||
|
# The list of all NASM programs with one main NASM file.
|
||||||
|
# Format of an item is exactly the same as in the previous list.
|
||||||
|
NASM_PROGRAMS:=\
|
||||||
|
demos/aclock:DEMOS/ACLOCK:$(PROGS)/demos/aclock/trunk/aclock.asm \
|
||||||
|
games/c4:GAMES/C4:$(PROGS)/games/c4/trunk/c4.asm \
|
||||||
|
# end of list
|
||||||
|
|
||||||
# The list of files which should be copied from somewhere.
|
# The list of files which should be copied from somewhere.
|
||||||
# Format of an item is exactly the same as in the previous list.
|
# Format of an item is exactly the same as in the previous list.
|
||||||
COPY_FILES:=\
|
COPY_FILES:=\
|
||||||
@ -198,7 +205,7 @@ OTHER_FILES:=asciivju:ASCIIVJU autorun.dat:AUTORUN.DAT \
|
|||||||
vmode:VMODE \
|
vmode:VMODE \
|
||||||
3d/3dsheart:3D/3DSHEART 3d/3dspiral:3D/3DSPIRAL 3d/cubeline:3D/CUBELINE \
|
3d/3dsheart:3D/3DSHEART 3d/3dspiral:3D/3DSPIRAL 3d/cubeline:3D/CUBELINE \
|
||||||
3d/flatwav:3D/FLATWAV 3d/gears:3D/GEARS 3d/house.3ds:3D/HOUSE.3DS \
|
3d/flatwav:3D/FLATWAV 3d/gears:3D/GEARS 3d/house.3ds:3D/HOUSE.3DS \
|
||||||
demos/aclock:DEMOS/ACLOCK demos/ak47.lif:DEMOS/AK47.LIF \
|
demos/ak47.lif:DEMOS/AK47.LIF \
|
||||||
demos/barge.lif:DEMOS/BARGE.LIF demos/life2:DEMOS/LIFE2 \
|
demos/barge.lif:DEMOS/BARGE.LIF demos/life2:DEMOS/LIFE2 \
|
||||||
demos/relay.lif:DEMOS/RELAY.LIF demos/rpento.lif:DEMOS/RPENTO.LIF \
|
demos/relay.lif:DEMOS/RELAY.LIF demos/rpento.lif:DEMOS/RPENTO.LIF \
|
||||||
demos/use_mb:DEMOS/USE_MB demos/web:DEMOS/WEB \
|
demos/use_mb:DEMOS/USE_MB demos/web:DEMOS/WEB \
|
||||||
@ -215,7 +222,7 @@ OTHER_FILES:=asciivju:ASCIIVJU autorun.dat:AUTORUN.DAT \
|
|||||||
fonts/bold.chr:FONTS/BOLD.CHR fonts/char2.mt:FONTS/CHAR2.MT \
|
fonts/bold.chr:FONTS/BOLD.CHR fonts/char2.mt:FONTS/CHAR2.MT \
|
||||||
fonts/char.mt:FONTS/CHAR.MT \
|
fonts/char.mt:FONTS/CHAR.MT \
|
||||||
games/appdata.dat:GAMES/APPDATA.DAT games/ataka:GAMES/ATAKA \
|
games/appdata.dat:GAMES/APPDATA.DAT games/ataka:GAMES/ATAKA \
|
||||||
games/basekurs.kla:GAMES/BASEKURS.KLA games/bnc:GAMES/BNC games/c4:GAMES/C4 \
|
games/basekurs.kla:GAMES/BASEKURS.KLA games/bnc:GAMES/BNC \
|
||||||
games/checkers:GAMES/CHECKERS games/clicks:GAMES/CLICKS \
|
games/checkers:GAMES/CHECKERS games/clicks:GAMES/CLICKS \
|
||||||
games/FindNumbers:GAMES/FindNumbers games/gomoku:GAMES/GOMOKU \
|
games/FindNumbers:GAMES/FindNumbers games/gomoku:GAMES/GOMOKU \
|
||||||
games/klavisha:GAMES/KLAVISHA games/kosilka:GAMES/KOSILKA \
|
games/klavisha:GAMES/KLAVISHA games/kosilka:GAMES/KOSILKA \
|
||||||
@ -249,9 +256,10 @@ fimage=$(call respace,$(call imagepart,$(f)))
|
|||||||
fsource=$(call respace,$(call sourcepart,$(f)))
|
fsource=$(call respace,$(call sourcepart,$(f)))
|
||||||
|
|
||||||
# Define targets for image file.
|
# Define targets for image file.
|
||||||
# Join lists $(FASM_PROGRAMS), $(COPY_FILES) and $(OTHER_FILES);
|
# Join all the lists above.
|
||||||
# for each item in the united list call fbinary.
|
targets_full:=$(COPY_FILES) $(FASM_PROGRAMS) $(NASM_PROGRAMS) $(OTHER_FILES)
|
||||||
targets:=$(foreach f,$(COPY_FILES) $(FASM_PROGRAMS) $(OTHER_FILES),$(fbinary))
|
# For each item in the united list call fbinary.
|
||||||
|
targets:=$(foreach f,$(targets_full),$(fbinary))
|
||||||
|
|
||||||
# Define a command for copying a file inside the image.
|
# Define a command for copying a file inside the image.
|
||||||
# mcopy_command is a macro with two parameters,
|
# mcopy_command is a macro with two parameters,
|
||||||
@ -271,7 +279,7 @@ define newline
|
|||||||
|
|
||||||
|
|
||||||
endef
|
endef
|
||||||
mcopy_all_items:=$(foreach f,$(FASM_PROGRAMS) $(COPY_FILES) $(OTHER_FILES),$(mcopy_item_command)$(newline))
|
mcopy_all_items:=$(foreach f,$(targets_full),$(mcopy_item_command)$(newline))
|
||||||
|
|
||||||
# The main goal: image.
|
# The main goal: image.
|
||||||
$(BUILD_DIR)/kolibri.img: $(BUILD_DIR)/.dir \
|
$(BUILD_DIR)/kolibri.img: $(BUILD_DIR)/.dir \
|
||||||
@ -314,14 +322,13 @@ File\ Managers/.dir:
|
|||||||
# FASM black magic goes to Makefile.fasm.
|
# FASM black magic goes to Makefile.fasm.
|
||||||
include Makefile.fasm
|
include Makefile.fasm
|
||||||
|
|
||||||
# Rule for copying files is simpler, but similar to previous.
|
# Similar for NASM.
|
||||||
define copy_meta_rule
|
include Makefile.nasm
|
||||||
$(1): $(2) Makefile $$(call respace,$$(addsuffix .dir,$(3)))
|
|
||||||
cp $$< "$$@"
|
|
||||||
endef
|
|
||||||
$(foreach f,$(COPY_FILES),$(eval $(call copy_meta_rule,$(fbinary),$(fsource),$(binarydir))))
|
|
||||||
|
|
||||||
# Special rules for copying sysfuncr.txt.
|
# Similar for copying files.
|
||||||
|
include Makefile.copy
|
||||||
|
|
||||||
|
# Special rules for copying sysfuncr.txt - it isn't directly included in the image.
|
||||||
docpak: $(DOCDIR)SYSFUNCR.TXT $(wildcard $(DOCDIR)*)
|
docpak: $(DOCDIR)SYSFUNCR.TXT $(wildcard $(DOCDIR)*)
|
||||||
$(DOCDIR)SYSFUNCR.TXT: $(KERNEL)/docs/sysfuncr.txt
|
$(DOCDIR)SYSFUNCR.TXT: $(KERNEL)/docs/sysfuncr.txt
|
||||||
cp $(KERNEL)/docs/sysfuncr.txt $(DOCDIR)SYSFUNCR.TXT
|
cp $(KERNEL)/docs/sysfuncr.txt $(DOCDIR)SYSFUNCR.TXT
|
||||||
|
6
data/rus/Makefile.copy
Normal file
6
data/rus/Makefile.copy
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# This is similar to Makefile.fasm, look there for comments.
|
||||||
|
define copy_meta_rule
|
||||||
|
$(1): $(2) Makefile.copy $$(call respace,$$(addsuffix .dir,$(3)))
|
||||||
|
cp $$< "$$@"
|
||||||
|
endef
|
||||||
|
$(foreach f,$(COPY_FILES),$(eval $(call copy_meta_rule,$(fbinary),$(fsource),$(binarydir))))
|
13
data/rus/Makefile.nasm
Normal file
13
data/rus/Makefile.nasm
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# This is similar to Makefile.fasm, look there for comments.
|
||||||
|
define nasm_meta_rule
|
||||||
|
.deps/$(4).Po: $(2) Makefile.nasm .deps/.dir
|
||||||
|
nasm -I$$(dir $(2)) -o "$(1)" -M $$< > .deps/$(4).Tpo 2>/dev/null; if [ $$$$? -eq 0 ]; \
|
||||||
|
then sed 's|\(.*\):|\1 .deps/$(4).Po:|' .deps/$(4).Tpo > .deps/$(4).Po; fi
|
||||||
|
rm -f .deps/$(4).Tpo
|
||||||
|
$(1): $(2) Makefile.nasm $$(call respace,$$(addsuffix .dir,$(3)))
|
||||||
|
nasm -I$$(dir $(2)) -o "$$@" $$<
|
||||||
|
kpack --nologo "$$@"
|
||||||
|
-include .deps/$(4).Po
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(foreach f,$(NASM_PROGRAMS),$(eval $(call nasm_meta_rule,$(fbinary),$(fsource),$(binarydir),$(progname))))
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user