Makefile
author mikek
Fri, 08 Jan 2010 16:16:51 +0000
changeset 1 820b22e13ff1
parent 0 37428ad74fc2
permissions -rw-r--r--
Commit further implemented Linux makefiles
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
     1
# Copyright (c) 2009 Symbian Foundation Ltd
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
     2
# This component and the accompanying materials are made available
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
     3
# under the terms of the License "Eclipse Public License v1.0"
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
     4
# which accompanies this distribution, and is available
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
     5
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
     6
#
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
     7
# Initial Contributors:
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
     8
# Symbian Foundation Ltd - initial contribution.
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
     9
# Mike Kinghan, mikek@symbian.org
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    10
#
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    11
# Contributors:
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    12
#
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    13
# Description:
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    14
# This is a Linux makefile for the Symbian build tools components.
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    15
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    16
epocroot := $(dir $(realpath ../epoc32))
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    17
ifneq '$(epocroot)' ''
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    18
epocroot := $(patsubst %/,%,$(epocroot))
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    19
$(warning WARNING: EPOCROOT not set. Assuming $(epocroot))
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    20
export EPOCROOT=$(epocroot)
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    21
else
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    22
$(error EPOCROOT must be defined as the parent directory of your epoc32 tree)
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    23
endif
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    24
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    25
ifdef EPOCROOT
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    26
include $(EPOCROOT)/build/makefiles-garage/global-make-env.mk
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    27
endif
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    28
1
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    29
ifeq '$(file)' ''
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    30
file = diffs.patch
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    31
endif
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    32
0
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    33
garage = $(EPOCROOT)/build/makefiles-garage
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    34
garage_makefiles = $(shell find $(garage) -name Makefile)
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    35
targets = $(notdir $(patsubst %/Makefile,%,$(garage_makefiles)))
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    36
clean_targets = $(addsuffix -clean,$(targets))
1
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    37
what_targets = $(addsuffix -what,$(targets))
0
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    38
garage_make_dirs = $(patsubst %/Makefile,%,$(garage_makefiles))
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    39
make_dirs = $(patsubst $(garage)%,$(EPOCROOT)/build%,$(garage_make_dirs)) 
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    40
makefiles = $(patsubst $(garage)/%,$(EPOCROOT)/build/%,$(garage_makefiles))
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    41
raptor_linux_binaries = $(EPOCROOT)/build/sbsv2/raptor/linux-*
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    42
new_subdirs = $(EPOCROOT)/build/imgtools/romtools/r_t_areaset
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    43
subdirs = imgtools e32tools sbsv2 srctools buildframework buildtoolguides bintools
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    44
	
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    45
.PHONY: all tools export gen_preinclude clean distclean deploy_makefiles gather_makefiles help \
1
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    46
sbs_comp_list sbs_targ_list list_fixups list_prereqs
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    47
0
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    48
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    49
all: tools
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    50
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    51
tools: $(preinclude) $(makefiles)
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    52
	for dir in $(subdirs); do $(MAKE) -C $$dir; done
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    53
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    54
 
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    55
#export: tools
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    56
#	for dir in $(subdirs); do $(MAKE) -C $$dir export; done
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    57
		
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    58
clean: $(makefiles)
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    59
	for dir in $(subdirs); do $(MAKE) -C $$dir clean; done
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    60
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    61
distclean: clean
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    62
	rm -f -r $(makefiles) $($(preinclude) $(linux_gcc_defs_inc) $(raptor_linux_binaries) $(new_subdirs)
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    63
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    64
help:
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    65
	@echo "Build the Symbian build tools by conventional GNU/Linux means."
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    66
	@echo "PHONY targets:"
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    67
	@echo "" 	
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    68
	@echo "  help"
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    69
	@echo "  all              - Build all real targets (default)"
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    70
	@echo "  clean            - Remove all build object files, libraries and executables"
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    71
	@echo "  TARGET-clean     - clean the real target TARGET"
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    72
	@echo "  distclean        - Remove everything but the original files"
1
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    73
	@echo "  deploy_makefiles - Copy makefiles from the 'makefiles_garage' to the locations where they run"
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    74
	@echo "  gather_makefiles - Gather any new or updated makefiles from the places where they run into the 'makefiles_garage'"
0
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    75
	@echo "  export           - TODO: No exports are implemented yet"
1
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    76
	@echo "  what             - List the files built by the real targets."
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    77
	@echo "  missing          - List the real targets that do not exist."
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    78
	@echo "  TARGET-what      - List the files built by the real target TARGET." 
0
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    79
	@echo "  sbs_comp_list    - List the components that sbs would find (BLD.INF files)"
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    80
	@echo "  sbs_targ_list    - List the targets that sbs would find (MMP files)"
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    81
	@echo "  list_prereqs     - List the dependency graph of final targets"
1
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    82
	@echo "  list_fixes       - List the targets and files for which fixes are currently applied."
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    83
	@echo "                     The fixes are applied by the make and removed by clean."
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    84
	@echo "  fix              - Just apply the fixes. Don't build."
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    85
	@echo "  diff [file=FILE] - List the diffs that are generated by applying the fixups."
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    86
	@echo "                     The diffs are written to FILE, if specified, else to ./diffs.patch."
0
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    87
	@echo ""  
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    88
	@echo "Real targets in hierarchy:"
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    89
	@echo ""
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    90
	@for file in $(sort $(garage_makefiles)); do \
1
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    91
		dummy=`grep '^include $$(EPOCROOT)/build/makefiles-garage/todo.mk' $$file 2> /dev/null`;\
0
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    92
		todo=;\
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    93
		file=$${file#$(garage)/};\
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    94
		file=$${file%/Makefile};\
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    95
		targ=$${file##*/};\
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    96
		file=$${file%/*};\
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    97
		file=$${file%$${targ}};\
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    98
		file=`echo $$file | sed -e 's|/||g' -`;\
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    99
		file=$${file//?/-};\
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   100
		if [ "$${dummy}" != "" ]; then todo='  ### TODO ###'; fi; \
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   101
		echo "  $$file$$targ$$todo";\
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   102
	done
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   103
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   104
$(makefiles): $(EPOCROOT)/build/%: $(garage)/%
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   105
	mkdir -p $(dir $@) && cp $< $@
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   106
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   107
deploy_makefiles: $(makefiles)
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   108
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   109
gather_makefiles:
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   110
	for dir in $(subdirs); do \
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   111
		grep --include Makefile -r -e 'include $$(EPOCROOT)/build/makefiles-garage/global-make-env.mk' $$dir | \
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   112
		sed -e 's|:include $$(EPOCROOT)/build/makefiles-garage/global-make-env.mk||g' -e 's|$(EPOCROOT)/build/||g' - | while read makefile; do \
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   113
			if [ ! -f $(garage)/$$makefile ]; then \
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   114
				echo "### Garaging new makefile $(garage)/$$makefile ###" ;\
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   115
				cp -f --parents $$makefile $(garage); \
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   116
			else if [ $(EPOCROOT)/build/$$makefile -nt $(garage)/$$makefile ]; then \
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   117
				if [ "`diff $(EPOCROOT)/build/$$makefile $(garage)/$$makefile`" != "" ]; then \
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   118
					echo "### Updating garaged makefile $(garage)/$$makefile ###" ;\
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   119
					cp -f --parents $$makefile $(garage); \
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   120
				fi; \
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   121
			fi; \
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   122
			fi; \
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   123
		done; \
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   124
	done
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   125
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   126
sbs_comp_list:
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   127
	@for file in `find . -iname 'bld.inf'`; do echo $${file}; done
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   128
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   129
sbs_targ_list:
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   130
	@for file in `find . -iname '*.mmp'`; do echo $${file}; done
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   131
1
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   132
list_fixes: $(makefiles)
0
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   133
	@for make_dir in $(sort $(make_dirs)); do \
1
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   134
		$(MAKE) -s -C $$make_dir call_in=1 targ=$${make_dir##*/} _list_fixes; \
0
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   135
	done	
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   136
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   137
list_prereqs: $(makefiles)
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   138
	@for make_dir in $(sort $(make_dirs)); do \
1
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   139
		$(MAKE) -s -C $$make_dir call_in=1 targ=$${make_dir##*/} _list_prereqs; \
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   140
	done
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   141
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   142
fix: $(makefiles)
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   143
	@for make_dir in $(sort $(make_dirs)); do \
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   144
		$(MAKE) -C $$make_dir call_in=1 fixes; \
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   145
	done
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   146
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   147
what: $(makefiles)
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   148
	@for make_dir in $(sort $(make_dirs)); do \
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   149
		$(MAKE) -s -C $$make_dir call_in=1 targ=$${make_dir##*/} _what; \
0
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   150
	done
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   151
1
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   152
missing: $(makefiles) 
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   153
	@for make_dir in $(sort $(make_dirs)); do \
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   154
		$(MAKE) -s -C $$make_dir call_in=1 targ=$${make_dir##*/} _missing; \
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   155
	done
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   156
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   157
diff:
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   158
	$(MAKE) distclean && \
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   159
	rm -fr ../pristine && \
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   160
	mkdir ../pristine && \
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   161
	cp -r -t ../pristine * && \
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   162
	$(MAKE) fix && \
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   163
	diff -r -b ../pristine ../build > $(file)
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   164
	for file in `find bintools/rcomp -name '*.CPP.original' -or -name '*.H.original' -or -name '*.LEX.original' -or -name '*.YACC.original'`; do \
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   165
		lcfile=$$(file%\.original) && \
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   166
		lcfile=`echo $$lcile | tr '[:upper:]' '[:lower:]'` && \
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   167
		diff -r -b $$file $$lcfile >> $(file); \
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   168
	done   
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   169
0
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   170
$(targets): $(preinclude) $(makefiles)
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   171
	garage_makedir=`find $(garage) -name $@`;\
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   172
	makedir=$${garage_makedir##$(garage)/};\
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   173
	makedir=$(EPOCROOT)/build/$${makedir};\
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   174
	$(MAKE) -C $${makedir}
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   175
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   176
$(clean_targets): $(makefiles)
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   177
	targ=$@; \
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   178
	targ=$${targ%-clean}; \
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   179
	garage_makedir=`find $(garage) -name $${targ}`;\
1
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   180
	if [ "$$garage_makedir" != "" ]; then \
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   181
		makedir=$${garage_makedir##$(garage)/};\
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   182
		makedir=$(EPOCROOT)/build/$${makedir};\
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   183
		$(MAKE) -C $${makedir} clean; \
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   184
	fi
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   185
0
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
   186
1
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   187
$(what_targets): $(makefiles)
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   188
	@targ=$@; \
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   189
	targ=$${targ%-what}; \
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   190
	garage_makedir=`find $(garage) -name $${targ}`;\
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   191
	if [ "$$garage_makedir" != "" ]; then \
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   192
		makedir=$${garage_makedir##$(garage)/};\
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   193
		makedir=$(EPOCROOT)/build/$${makedir};\
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   194
		$(MAKE) -C $${makedir} call_in=1 targ=$${make_dir##*/} what; \
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   195
	fi
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   196