Rev 922 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log
| Rev 922 | Rev 930 | ||
|---|---|---|---|
| Line 1... | Line 1... | ||
| 1 | # iar.mk - definitions to support IAR in Makefiles. |
1 | # iar.mk - definitions to support IAR in Makefiles. |
| 2 | # |
2 | # |
| 3 | # Supported environments: |
3 | # Supported environments: |
| 4 | # GNU/Linux |
4 | # GNU/Linux. |
| - | 5 | # |
|
| - | 6 | # Tools used: |
|
| - | 7 | # GNU core utilities, tools/aspp, GCC (or similar tool to generate dependency information), |
|
| 5 | # Windows NT |
8 | # Wine, IAR tools. |
| - | 9 | # |
|
| - | 10 | # Variables used: |
|
| - | 11 | # DEPCC - C preprocessor name (with GCC-compatible parameters) |
|
| - | 12 | # DEPCFLAGS - flags for ${DEPCC} |
|
| - | 13 | # DEPAS - tools/aspp name |
|
| - | 14 | # DEPAFLAGS - flags for ${DEPAS} |
|
| - | 15 | # DEPEXT - dependency file extension (no leading dot) |
|
| - | 16 | # WINE - Wine's name with "cmd /c" command in parameters |
|
| - | 17 | # IAR_ICCZ80 - IAR's "iccz80" name |
|
| - | 18 | # IAR_ICCZ80FLAGS - flags for ${IAR_ICCZ80} |
|
| - | 19 | # IAR_AZ80 - IAR's "az80" name |
|
| - | 20 | # IAR_AZ80FLAGS - flags for ${IAR_AZ80} |
|
| 6 | 21 | ||
| - | 22 | # iar_iccz80_rule - rule to compile C source file using tools ${DEPCC}, ${WINE} and ${IAR_ICCZ80} |
|
| - | 23 | # |
|
| - | 24 | # Parameters: |
|
| 7 | # Uses "common.mk" |
25 | # ${1} = output file(s) |
| - | 26 | # ${2} = single input file |
|
| - | 27 | # ${3} = extra parameters for IAR's ${IAR_ICCZ80} |
|
| - | 28 | # ${4} = variable's name for output dependencies files list (or empty) |
|
| - | 29 | # ${5} = variable's name for output binaries files list (or empty) |
|
| - | 30 | # |
|
| - | 31 | # Usage: |
|
| - | 32 | # ${eval ${call iar_iccz80_rule,${OBJDIR}/main.r01,main.asm,-O${OBJDIR}/,DEPS,OBJS}} |
|
| 8 | 33 | ||
| 9 | ifeq ($(OS),Windows_NT) |
34 | define iar_iccz80_rule = |
| 10 | IARDIR = $(ROOTDIR)iar/ |
35 | # Dependency generation rule for .asm file: |
| - | 36 | ${patsubst %${suffix ${2}},%.${DEPEXT},${2}}: ${2} |
|
| - | 37 | $${RM} $$@ && $${DEPCC} $${DEPCFLAGS} ${addprefix -MT ,${1}} -MT $$@ -MF $$@ $$< || true |
|
| - | 38 | ${1}: ${2} |
|
| 11 | IARBIN = $(IARDIR)bin/ |
39 | $${WINE} $${IAR_ICCZ80} $${IAR_ICCZ80FLAGS} ${3} $$< |
| - | 40 | ifneq "${4}" "" |
|
| - | 41 | ${4}+=${patsubst %${suffix ${2}},%.${DEPEXT},${2}} |
|
| - | 42 | endif |
|
| 12 | IARINC = $(IARDIR)inc/ |
43 | ifneq "${5}" "" |
| - | 44 | ${5}+=${1} |
|
| - | 45 | endif |
|
| - | 46 | endef |
|
| - | 47 | ||
| - | 48 | # iar_az80_rule - rule to compile assembler source file using tools ${DEPAS}, ${WINE} and ${IAR_AZ80} |
|
| - | 49 | # |
|
| - | 50 | # Parameters: |
|
| 13 | IARLIB = $(IARDIR)lib/ |
51 | # ${1} = output file(s) |
| 14 | AZ80 = $(IARBIN)az80.exe |
52 | # ${2} = single input file |
| 15 | ICCZ80 = $(IARBIN)iccz80.exe |
53 | # ${3} = extra parameters for ${IAR_AZ80} |
| - | 54 | # ${4} = variable's name for output dependencies files list (or empty) |
|
| - | 55 | # ${5} = variable's name for output binaries files list (or empty) |
|
| - | 56 | # |
|
| - | 57 | # Usage: |
|
| - | 58 | # ${eval ${call iar_az80_rule,${OBJDIR}/main.r01,main.asm,-O{OBJDIR}/,DEPS,OBJS}} |
|
| - | 59 | ||
| 16 | XLIB = $(IARBIN)xlib.exe |
60 | define iar_az80_rule = |
| 17 | XLINK = $(IARBIN)xlink.exe |
61 | # Dependency generation rule for .asm file: |
| - | 62 | ${patsubst %${suffix ${2}},%.${DEPEXT},${2}}: ${2} |
|
| - | 63 | $${RM} $$@ && $${DEPAS} $${DEPAFLAGS} ${addprefix -MT ,${1}} -MT $$@ -MF $$@ $$< |
|
| - | 64 | ${1}: ${2} |
|
| - | 65 | $${WINE} $${IAR_AZ80} $${IAR_AZ80FLAGS} ${3} $$< |
|
| - | 66 | ifneq "${4}" "" |
|
| - | 67 | ${4}+=${patsubst %${suffix ${2}},%.${DEPEXT},${2}} |
|
| 18 | else |
68 | endif |
| 19 | $(warning IAR tools are not available) |
69 | ifneq "${5}" "" |
| - | 70 | ${5}+=${1} |
|
| 20 | endif |
71 | endif |
| - | 72 | endef |
|