Changeset 1936

Show
Ignore:
Timestamp:
11/20/08 19:14:01 (2 months ago)
Author:
batt
Message:

Increase readability.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/bertos/rules.mk

    r1694 r1936  
    6969 
    7070ifneq ($$($(1)_CROSS),) 
    71 #use embedded specific map flags 
    72 $(1)_MAP_FLAGS = $$(MAP_FLAGS_EMB) 
    73 #In embedded we need s19, hex and bin 
    74 $$(OUTDIR)/$(1).tgt : $$(OUTDIR)/$(1).s19 $$(OUTDIR)/$(1).hex $$(OUTDIR)/$(1).bin 
     71        #use embedded specific map flags 
     72        $(1)_MAP_FLAGS = $$(MAP_FLAGS_EMB) 
     73        #In embedded we need s19, hex and bin 
     74        $$(OUTDIR)/$(1).tgt : $$(OUTDIR)/$(1).s19 $$(OUTDIR)/$(1).hex $$(OUTDIR)/$(1).bin 
    7575else 
    76 #On Darwin architecture the assembly doesn't link correctly if this flag is set. 
    77 ifeq ($(shell uname | grep -c "Darwin"),1) 
    78 LIST_FLAGS := "" 
    79 MAP_FLAGS := "" 
    80 LDFLAGS := "" 
    81 endif 
    82 #use hosted specific map flags 
    83 $(1)_MAP_FLAGS = $$(MAP_FLAGS_HOST) 
    84 #in hosted application we need only executable file. 
    85 $$(OUTDIR)/$(1).tgt : $$(OUTDIR)/$(1) 
     76        #On Darwin architecture the assembly doesn't link correctly if this flag is set. 
     77        ifeq ($(shell uname | grep -c "Darwin"),1) 
     78                LIST_FLAGS := "" 
     79                MAP_FLAGS := "" 
     80                LDFLAGS := "" 
     81        endif 
     82        #use hosted specific map flags 
     83        $(1)_MAP_FLAGS = $$(MAP_FLAGS_HOST) 
     84        #in hosted application we need only executable file. 
     85        $$(OUTDIR)/$(1).tgt : $$(OUTDIR)/$(1) 
    8686endif 
    8787 
     
    9292# it to the compiler. 
    9393ifneq ($$(strip $$($(1)_MCU)),) 
    94 $(1)_MCPU = -mmcu=$$($(1)_MCU) 
     94        $(1)_MCPU = -mmcu=$$($(1)_MCU) 
    9595endif 
    9696ifneq ($$(strip $$($(1)_CPU)),) 
    97 $(1)_MCPU = -mcpu=$$($(1)_CPU) 
     97        $(1)_MCPU = -mcpu=$$($(1)_CPU) 
    9898endif 
    9999 
     
    101101# project specific flags. 
    102102ifneq ($$($(1)_MCPU),) 
    103 $(1)_CFLAGS    += $$($(1)_MCPU) 
    104 $(1)_CXXFLAGS  += $$($(1)_MCPU) 
    105 $(1)_ASFLAGS   += $$($(1)_MCPU) 
    106 $(1)_CPPAFLAGS += $$($(1)_MCPU) 
    107 $(1)_LDFLAGS   += $$($(1)_MCPU) 
     103        $(1)_CFLAGS    += $$($(1)_MCPU) 
     104        $(1)_CXXFLAGS  += $$($(1)_MCPU) 
     105        $(1)_ASFLAGS   += $$($(1)_MCPU) 
     106        $(1)_CPPAFLAGS += $$($(1)_MCPU) 
     107        $(1)_LDFLAGS   += $$($(1)_MCPU) 
    108108endif 
    109109 
    110110ifneq ($$(strip $$($(1)_LDSCRIPT)),) 
    111 $(1)_LDFLAGS += -Wl,-T$$($(1)_LDSCRIPT) 
     111        $(1)_LDFLAGS += -Wl,-T$$($(1)_LDSCRIPT) 
    112112endif 
    113113 
    114114# Debug stuff 
    115115ifeq ($$($(1)_DEBUG),1) 
    116        # AVR is an harvard processor 
    117        # and needs debug module 
    118        # to be compiled in program memory 
    119        ifeq ($$(findstring avr, $$($(1)_CROSS)),avr) 
    120                $(1)_DEBUGSRC = $(1)_PCSRC 
    121        else 
    122                $(1)_DEBUGSRC = $(1)_CSRC 
    123        endif 
    124          
    125        $$($(1)_DEBUGSRC) += bertos/drv/kdebug.c 
    126  
    127        # Also add formatwr.c (printf) if not already present 
    128        ifneq ($$(findstring formatwr.c, $$($$($(1)_DEBUGSRC))),formatwr.c) 
    129                $$($(1)_DEBUGSRC) += bertos/mware/formatwr.c 
    130        endif 
    131  
    132        $(1)_CFLAGS += -D_DEBUG         
    133        $(1)_CXXFLAGS += -D_DEBUG 
     116        # AVR is an harvard processor 
     117        # and needs debug module 
     118        # to be compiled in program memory 
     119        ifeq ($$(findstring avr, $$($(1)_CROSS)),avr) 
     120                $(1)_DEBUGSRC = $(1)_PCSRC 
     121        else 
     122                $(1)_DEBUGSRC = $(1)_CSRC 
     123        endif 
     124 
     125        $$($(1)_DEBUGSRC) += bertos/drv/kdebug.c 
     126 
     127        # Also add formatwr.c (printf) if not already present 
     128        ifneq ($$(findstring formatwr.c, $$($$($(1)_DEBUGSRC))),formatwr.c) 
     129                $$($(1)_DEBUGSRC) += bertos/mware/formatwr.c 
     130        endif 
     131 
     132        $(1)_CFLAGS += -D_DEBUG        
     133        $(1)_CXXFLAGS += -D_DEBUG 
    134134endif 
    135135 
     
    159159# "++" in the name is a kludge that seems to work mostly. 
    160160ifeq (++,$$(findstring ++,$$($(1)_CC))) 
    161        REAL_CFLAGS = $$(CXXFLAGS) 
     161        REAL_CFLAGS = $$(CXXFLAGS) 
    162162else 
    163        REAL_CFLAGS = $$(CFLAGS) 
     163        REAL_CFLAGS = $$(CFLAGS) 
    164164endif 
    165165