Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CC=aarch64-none-elf-gcc
- CFLAGS = -Iinclude -O0 -g -ffreestanding -Wall -Wextra -Werror
- LDFLAGS = -nostartfiles -nostdlib
- LIBS = -lgcc
- ARCHDIR=src/arch/aarch64
- BSPDIR=src/bsp/rpi3
- CSRCS = $(wildcard src/*.c) \
- $(wildcard $(ARCHDIR)/*.c) $(wildcard $(ARCHDIR)/*/*.c) \
- $(wildcard $(BSPDIR)/*.c) $(wildcard $(BSPDIR)/*/*.c) \
- SSRCS = $(wildcard src/*.S) $(wildcard src/*/*.S) \
- $(wildcard $(ARCHDIR)/*.S) $(wildcard $(ARCHDIR)/*/*.S) \
- $(wildcard $(BSPDIR)/*.S) $(wildcard $(BSPDIR)/*/*.S) \
- COBJS = $(patsubst %.c, %.o, $(CSRCS))
- SOBJS = $(patsubst %.S, %.o, $(SSRCS)) \
- LINK_LIST=\
- $(LDFLAGS) \
- $(COBJS) \
- $(SOBJS) \
- $(LIBS) \
- .PHONY: all clean
- .SUFFIXES: .o .c .S
- all: plaid.elf
- plaid.elf: $(OBJS) $(ARCHDIR)/linker.ld
- $(info $$CSRCS is [${CSRCS}])
- $(info $$SSRCS is [${SSRCS}])
- $(info $$COBJS is [$(COBJS)])
- $(info $$SOBJS is [$(SOBJS)])
- $(CC) -T $(ARCHDIR)/linker.ld -o $@ $(CFLAGS) $(LINK_LIST)
- %.o: %.c
- $(CC) -MD -c $< -o $@ -std=gnu11 $(CFLAGS) $(CPPFLAGS)
- %.o: %.S
- $(CC) -MD -c $< -o $@ $(CFLAGS) $(CPPFLAGS)
- clean:
- rm -f plaid.elf
- rm -f *.o */*.o */*/*.o
- rm -f *.d */*.d */*/*.d
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement