Rev 922 | Details | Compare with Previous | Last modification | View Log
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 480 | baho | 1 | # iar.mk - definitions to support IAR in Makefiles. |
| 2 | # |
||
| 3 | # Supported environments: |
||
| 930 | alone | 4 | # GNU/Linux. |
| 5 | # |
||
| 6 | # Tools used: |
||
| 7 | # GNU core utilities, tools/aspp, GCC (or similar tool to generate dependency information), |
||
| 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} |
||
| 480 | baho | 21 | |
| 930 | alone | 22 | # iar_iccz80_rule - rule to compile C source file using tools ${DEPCC}, ${WINE} and ${IAR_ICCZ80} |
| 23 | # |
||
| 24 | # Parameters: |
||
| 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}} |
||
| 480 | baho | 33 | |
| 930 | alone | 34 | define iar_iccz80_rule = |
| 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} |
||
| 39 | $${WINE} $${IAR_ICCZ80} $${IAR_ICCZ80FLAGS} ${3} $$< |
||
| 40 | ifneq "${4}" "" |
||
| 41 | ${4}+=${patsubst %${suffix ${2}},%.${DEPEXT},${2}} |
||
| 480 | baho | 42 | endif |
| 930 | alone | 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: |
||
| 51 | # ${1} = output file(s) |
||
| 52 | # ${2} = single input file |
||
| 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 | |||
| 60 | define iar_az80_rule = |
||
| 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}} |
||
| 68 | endif |
||
| 69 | ifneq "${5}" "" |
||
| 70 | ${5}+=${1} |
||
| 71 | endif |
||
| 72 | endef |