############################################################################### # Copyright (c) 2010 Linaro Limited # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html # # Contributors: # Peter Maydell (Linaro) - initial implementation # Claudio Fontana (Linaro) - small refactoring and aarch64 support ############################################################################### # import the variables generated by configure include Makefile.in VPATH=$(SRCDIR) CFLAGS ?= -g ALL_CFLAGS = -Wall -D_GNU_SOURCE -DARCH=$(ARCH) -U$(ARCH) $(BUILD_INC) $(CFLAGS) $(EXTRA_CFLAGS) PROG=risu SRCS=risu.c comms.c risu_$(ARCH).c risu_reginfo_$(ARCH).c HDRS=risu.h risu_reginfo_$(ARCH).h BINS=test_$(ARCH).bin # For dumping test patterns RISU_BINS=$(wildcard *.risu.bin) RISU_ASMS=$(patsubst %.bin,%.asm,$(RISU_BINS)) OBJS=$(SRCS:.c=.o) all: $(PROG) $(BINS) dump: $(RISU_ASMS) $(PROG): $(OBJS) $(CC) $(STATIC) $(ALL_CFLAGS) -o $@ $^ $(LDFLAGS) %.risu.asm: %.risu.bin ${OBJDUMP} -b binary -m $(ARCH) -D $^ > $@ %.o: %.c $(HDRS) $(CC) $(CPPFLAGS) $(ALL_CFLAGS) -o $@ -c $< %_$(ARCH).bin: %_$(ARCH).elf $(OBJCOPY) -O binary $< $@ %_$(ARCH).elf: %_$(ARCH).s $(AS) -o $@ $< %_$(ARCH).elf: %_$(ARCH).S $(CC) $(CPPFLAGS) -o $@ -c $< clean: rm -f $(PROG) $(OBJS) $(BINS) distclean: clean rm -f config.h Makefile.in