1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
|
#
# Copyright 1999 Silicon Graphics, Inc.
# Copyright 2002-2004 Guido Guenther <agx@sigxcpu.org>
# Copyright (C) 2004 by Thiemo Seufer
#
# default subarch
SUBARCH ?= IP22
# these contain subarch independent files
SUBARCH_INDEP_DIRS= \
arclib \
tip22
# these contain subarch dependent files
SUBARCH_DIRS= \
common \
ext2load
define indep-tgt
$(foreach sd,$(SUBARCH_INDEP_DIRS),$(1)-subarch-indep-$(sd))
endef
define dep-tgt
$(foreach sd,$(SUBARCH_DIRS),$(1)-subarch-dep-$(sd))
endef
define build-indep-tgt
$(call indep-tgt,build)
endef
define build-dep-tgt
$(call dep-tgt,build)
endef
define install-indep-tgt
$(call indep-tgt,install)
endef
define install-dep-tgt
$(call dep-tgt,install)
endef
define clean-indep-tgt
$(call indep-tgt,clean)
endef
define clean-dep-tgt
$(call dep-tgt,clean)
endef
define submake
@$(MAKE) -C $(1) SUBARCH=$(SUBARCH) $(2)
endef
all: build
build: build-subarch-indep build-subarch-dep
build-subarch-indep: $(build-indep-tgt)
build-subarch-dep: $(build-dep-tgt)
$(build-indep-tgt):
$(call submake,$(patsubst build-subarch-indep-%,%,$@),all)
$(build-dep-tgt):
$(call submake,$(patsubst build-subarch-dep-%,%,$@),all)
install: install-subarch-indep install-subarch-dep
install-subarch-indep: $(install-indep-tgt)
install-subarch-dep: $(install-dep-tgt)
$(install-indep-tgt):
$(call submake,$(patsubst install-subarch-indep-%,%,$@),install)
$(install-dep-tgt):
$(call submake,$(patsubst install-subarch-dep-%,%,$@),install)
clean: clean-subarch-indep clean-subarch-dep
clean-subarch-indep: $(clean-indep-tgt)
clean-subarch-dep: $(clean-dep-tgt)
$(clean-indep-tgt):
$(call submake,$(patsubst clean-subarch-indep-%,%,$@),clean)
$(clean-dep-tgt):
$(call submake,$(patsubst clean-subarch-dep-%,%,$@),clean)
.PHONY: all \
build build-subarch-indep build-subarch-dep \
$(build-indep-tgt) $(build-dep-tgt) \
clean clean-subarch-indep clean-subarch-dep \
$(clean-indep-tgt) $(clean-dep-tgt)
|