ARMGNU = arm-none-eabi

TARGET = library
DEPS = *.h

COPS = -Wall -O2 -nostdlib -nostartfiles -ffreestanding

all : $(TARGET) 

cp : $(TARGET) 

copy : clean $(TARGET) 

%.o : %.s
	$(ARMGNU)-as $< -o $@

%.o : %.c $(DEPS)
	$(ARMGNU)-gcc $(COPS) -c $< -o $@

OBJECTS := $(patsubst %.s,%.o,$(wildcard *.s)) $(patsubst %.c,%.o,$(wildcard *.c))

$(TARGET) : $(OBJECTS)

clean :
	rm -f *.o
	rm -f *.bin
	rm -f *.elf
	rm -f *.list
	rm -f *.auto


