summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/addtargetdir.pl1
-rw-r--r--tools/functions.make4
-rw-r--r--tools/root.make11
3 files changed, 14 insertions, 2 deletions
diff --git a/tools/addtargetdir.pl b/tools/addtargetdir.pl
index 6a9a72a878..2868e9027b 100755
--- a/tools/addtargetdir.pl
+++ b/tools/addtargetdir.pl
@@ -23,6 +23,7 @@ my $src;
23# Split the input file on any runs of '\' and whitespace. 23# Split the input file on any runs of '\' and whitespace.
24for (split(/[\s\\]+/m, <STDIN>)) { 24for (split(/[\s\\]+/m, <STDIN>)) {
25 /^(\/)?[^:]+(\:)?$/; 25 /^(\/)?[^:]+(\:)?$/;
26print ">>$& $src"
26# Save target and continue if this item ends in ':' 27# Save target and continue if this item ends in ':'
27 if (!($2 && ($target=$&))) { 28 if (!($2 && ($target=$&))) {
28 $src = $&; 29 $src = $&;
diff --git a/tools/functions.make b/tools/functions.make
index 66354ebc18..ba444267c4 100644
--- a/tools/functions.make
+++ b/tools/functions.make
@@ -25,6 +25,9 @@ preprocess = $(shell $(CC) $(PPCFLAGS) $(2) -E -P -x c -include config.h $(1) |
25preprocess2file = $(shell $(CC) $(PPCFLAGS) $(3) -E -P -x c -include config.h $(1) | \ 25preprocess2file = $(shell $(CC) $(PPCFLAGS) $(3) -E -P -x c -include config.h $(1) | \
26 grep -v '^\#' | grep -v "^$$" > $(2)) 26 grep -v '^\#' | grep -v "^$$" > $(2))
27 27
28asmdefs2file = $(shell $(CC) $(PPCFLAGS) $(3) -S -x c -o - -include config.h $(1) | \
29 perl -ne 'if(/^AD_(\w+):$$/){$$var=$$1}else{/^\W\.word\W(.*)$$/ && $$var && print "\#define $$var $$1\n";$$var=0}' > $2)
30
28c2obj = $(addsuffix .o,$(basename $(subst $(ROOTDIR),$(BUILDDIR),$(1)))) 31c2obj = $(addsuffix .o,$(basename $(subst $(ROOTDIR),$(BUILDDIR),$(1))))
29 32
30# calculate dependencies for a list of source files $(2) and output them 33# calculate dependencies for a list of source files $(2) and output them
@@ -32,6 +35,7 @@ c2obj = $(addsuffix .o,$(basename $(subst $(ROOTDIR),$(BUILDDIR),$(1))))
32mkdepfile = $(shell \ 35mkdepfile = $(shell \
33 $(CC) $(PPCFLAGS) $(OTHER_INC) -MG -MM -include config.h $(2) | \ 36 $(CC) $(PPCFLAGS) $(OTHER_INC) -MG -MM -include config.h $(2) | \
34 sed -e "s: lang.h: lang/lang_core.o:" \ 37 sed -e "s: lang.h: lang/lang_core.o:" \
38 -e 's:_asmdefs.o:_asmdefs.h:' \
35 -e "s: max_language_size.h: lang/max_language_size.h:" | \ 39 -e "s: max_language_size.h: lang/max_language_size.h:" | \
36 $(TOOLSDIR)/addtargetdir.pl $(ROOTDIR) $(BUILDDIR) \ 40 $(TOOLSDIR)/addtargetdir.pl $(ROOTDIR) $(BUILDDIR) \
37 >> $(1)_) 41 >> $(1)_)
diff --git a/tools/root.make b/tools/root.make
index 00586379c6..8a923983f9 100644
--- a/tools/root.make
+++ b/tools/root.make
@@ -51,8 +51,8 @@ endif
51 51
52all: $(DEPFILE) build 52all: $(DEPFILE) build
53 53
54# Subdir makefiles. their primary purpose is to populate SRC & OTHER_SRC 54# Subdir makefiles. their primary purpose is to populate SRC, OTHER_SRC &
55# but they also define special dependencies and compile rules 55# ASMDEFS_SRC but they also define special dependencies and compile rules
56include $(TOOLSDIR)/tools.make 56include $(TOOLSDIR)/tools.make
57include $(FIRMDIR)/firmware.make 57include $(FIRMDIR)/firmware.make
58include $(ROOTDIR)/apps/bitmaps/bitmaps.make 58include $(ROOTDIR)/apps/bitmaps/bitmaps.make
@@ -96,6 +96,7 @@ $(DEPFILE) dep:
96 @echo foo > /dev/null # there must be a "real" command in the rule 96 @echo foo > /dev/null # there must be a "real" command in the rule
97 $(call mkdepfile,$(DEPFILE),$(SRC)) 97 $(call mkdepfile,$(DEPFILE),$(SRC))
98 $(call mkdepfile,$(DEPFILE),$(OTHER_SRC)) 98 $(call mkdepfile,$(DEPFILE),$(OTHER_SRC))
99 $(call mkdepfile,$(DEPFILE),$(ASMDEFS_SRC))
99 @mv $(DEPFILE)_ $(DEPFILE) 100 @mv $(DEPFILE)_ $(DEPFILE)
100 $(call bmpdepfile,$(DEPFILE),$(BMP) $(PBMP)) 101 $(call bmpdepfile,$(DEPFILE),$(BMP) $(PBMP))
101 102
@@ -317,6 +318,12 @@ $(BUILDDIR)/%.o: $(ROOTDIR)/%.S
317 $(SILENT)mkdir -p $(dir $@) 318 $(SILENT)mkdir -p $(dir $@)
318 $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(CFLAGS) -c $< -o $@ 319 $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(CFLAGS) -c $< -o $@
319 320
321# generated definitions for use in .S files
322$(BUILDDIR)/%_asmdefs.h: $(ROOTDIR)/%_asmdefs.c
323 $(call PRINTS,ASMDEFS $(@F))
324 $(SILENT)mkdir -p $(dir $@)
325 $(call asmdefs2file,$<,$@)
326
320# when source and object are both in BUILDDIR (generated code): 327# when source and object are both in BUILDDIR (generated code):
321%.o: %.c 328%.o: %.c
322 $(SILENT)mkdir -p $(dir $@) 329 $(SILENT)mkdir -p $(dir $@)