aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorClaudio Fontana <claudio.fontana@huawei.com>2013-09-18 15:29:09 +0200
committerPeter Maydell <peter.maydell@linaro.org>2014-04-25 13:07:15 +0100
commitfb23958d938f8c75f1fc63b3616240d67aaf5a97 (patch)
treeeefd6a2051845ef4400df686526a5edc38a0ae85 /Makefile
parent4aec4538c8ff3c687943bd3b1bacc8705382d9e1 (diff)
configure: add a configuration step, prepare for 64bit compilation
adjust some types to be able to compile successfully on 64 bit. To make it cleanly, add a configure step to check for the appropriate types to use. Signed-off-by: Claudio Fontana <claudio.fontana@linaro.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile21
1 files changed, 11 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index d041a94..9c934cb 100644
--- a/Makefile
+++ b/Makefile
@@ -7,9 +7,13 @@
#
# Contributors:
# Peter Maydell (Linaro) - initial implementation
+# Claudio Fontana (Linaro) - small refactoring and aarch64 support
###############################################################################
-ARCH=$(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
+# import the variables generated by configure
+include Makefile.in
+
+CFLAGS ?= -g -Wall
PROG=risu
SRCS=risu.c comms.c risu_$(ARCH).c
@@ -21,19 +25,16 @@ OBJS=$(SRCS:.c=.o)
all: $(PROG) $(BINS)
$(PROG): $(OBJS)
- $(CC) -g -Wall -Werror -o $@ $^
+ $(CC) $(CFLAGS) -o $@ $^
%.o: %.c $(HDRS)
- $(CC) -g -Wall -Werror -o $@ -c $<
-
-%_i386.bin: %_i386.s
- nasm -f bin -o $@ $<
+ $(CC) $(CFLAGS) -o $@ -c $<
-%_arm.bin: %_arm.elf
- objcopy -O binary $< $@
+%_$(ARCH).bin: %_$(ARCH).elf
+ $(OBJCOPY) -O binary $< $@
-%_arm.elf: %_arm.s
- as -o $@ $<
+%_$(ARCH).elf: %_$(ARCH).s
+ $(AS) -o $@ $<
clean:
rm -f $(PROG) $(OBJS) $(BINS)