mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-24 01:41:39 +00:00
27 lines
435 B
Makefile
27 lines
435 B
Makefile
![]() |
|
||
|
SOURCES := $(wildcard [0-9]*x[0-9]*.S)
|
||
|
|
||
|
BIN := $(patsubst %.S, %.bin, $(SOURCES))
|
||
|
|
||
|
IHEX := $(patsubst %.S, %.bin.ihex, $(SOURCES))
|
||
|
|
||
|
CODE := $(patsubst %.S, %.c, $(SOURCES))
|
||
|
|
||
|
all: $(BIN) $(IHEX) $(CODE)
|
||
|
|
||
|
clean:
|
||
|
@rm -f *.o *.bin.ihex *.bin *.c
|
||
|
|
||
|
%.o: %.S
|
||
|
@cc -c $^
|
||
|
|
||
|
%.bin: %.o
|
||
|
@objcopy -Obinary $^ $@
|
||
|
|
||
|
%.bin.ihex: %.o
|
||
|
@objcopy -Oihex $^ $@
|
||
|
@dos2unix $@ 2>/dev/null
|
||
|
|
||
|
%.c: %.bin
|
||
|
@echo "{" >$@; hexdump -f hex $^ >>$@; echo "};" >>$@
|