Code: Select all
#
# hello.s - As simple a program as you can get. Just to get a compile
# and successful run.
#
.section .text, "x"
.global _start
_start:
ADD r0, r0, r1
MOV pc, lr
Makefile:
Code: Select all
##
## Macros
##
# Environment macros
AS=as
LD=ld
#CC=C:/MinGW/bin/gcc.exe
#RC=C:/MinGW/bin/windres.exe
RM=rm -f
# Project macros
EXE_NAME=hello #Put the name you want the executable to have here
ASFLAGS=-march=armv4t
LDFLAGS=
##
## File List
##
# Project file list (leave off the suffixes)
SOURCE_FILES= \
hello
# 3rd party file list
LIBRARIES= \
#Put any required 3rd party libraries here
##
## Suffix rules (do not change)
##
##
## Commands (do not change)
##
# Build the executable only
exe: \
compile \
all
# Compile all files
compile: ${SOURCE_FILES:=.s}
${AS} ${ASFLAGS} -o ${SOURCE_FILES:=.o} ${SOURCE_FILES:=.s} ${LIBRARIES}
# Link object files into executable
all: ${SOURCE_FILES:=.o}
${LD} ${LDFLAGS} -o ${EXE_NAME} ${SOURCE_FILES:=.o} ${LIBRARIES}
# Get rid of all non-source files
clean:
${RM} ${EXE_NAME} ${SOURCE_FILES:=.o}