2 CLANG
=clang
-target lm32
5 AS_normal
:= $(TARGET_PREFIX
)-as
6 AR_normal
:= $(TARGET_PREFIX
)-ar
7 LD_normal
:= $(TARGET_PREFIX
)-ld
8 OBJCOPY_normal
:= $(TARGET_PREFIX
)-objcopy
9 RANLIB_normal
:= $(TARGET_PREFIX
)-ranlib
11 CC_quiet
= @echo
" CC " $@
&& $(CLANG
)
12 AS_quiet
= @echo
" AS " $@
&& $(TARGET_PREFIX
)-as
13 AR_quiet
= @echo
" AR " $@
&& $(TARGET_PREFIX
)-ar
14 LD_quiet
= @echo
" LD " $@
&& $(TARGET_PREFIX
)-ld
15 OBJCOPY_quiet
= @echo
" OBJCOPY " $@
&& $(TARGET_PREFIX
)-objcopy
16 RANLIB_quiet
= @echo
" RANLIB " $@
&& $(TARGET_PREFIX
)-ranlib
23 OBJCOPY
= $(OBJCOPY_normal
)
24 RANLIB
= $(RANLIB_normal
)
30 OBJCOPY
= $(OBJCOPY_quiet
)
31 RANLIB
= $(RANLIB_quiet
)
36 INCLUDES
= -I
$(M2DIR
)/software
/include/base
-I
$(M2DIR
)/software
/include -I
$(M2DIR
)/common
37 CFLAGS
= -O3
-Wall
-Wstrict-prototypes
-Wold-style-definition
-Wshadow \
38 -Wmissing-prototypes
-nostdinc
$(INCLUDES
)
39 LDFLAGS
= -nostdlib
-nodefaultlibs
41 # compile and generate dependencies, based on
42 # http://scottmcpeak.com/autodepend/autodepend.html
45 $(CC
) -c
$(CFLAGS
) $< -o
$*.ts
-S
46 @
$(CC_normal
) -MM
$(CFLAGS
) $< > $*.d
48 @sed
-e
's|.*:|$*.o:|' < $*.d.tmp
> $*.d
49 @sed
-e
's/.*://' -e
's/\\$$//' < $*.d.tmp | fmt
-1 | \
50 sed
-e
's/^ *//' -e
's/$$/:/' >> $*.d
52 @
$(AS_normal
) -o
$*.o
$*.ts