2020-06-18 05:17:49 -04:00
|
|
|
TARGET = mkbootimg
|
|
|
|
|
|
|
|
CC = gcc
|
|
|
|
CFLAGS = -Wall -Wextra -ansi -pedantic
|
|
|
|
SRCS = $(filter-out bin2h.c data.c,$(wildcard *.c)) data.c
|
|
|
|
|
|
|
|
ifneq ("$(wildcard /bin/*.exe)","")
|
|
|
|
LIBDIRS = -static -static-libgcc
|
|
|
|
ZIPNAME = ../$(TARGET)-Win.zip
|
|
|
|
else
|
|
|
|
ifneq ("$(wildcard /Applications/*)","")
|
|
|
|
ZIPNAME = ../$(TARGET)-MacOSX.zip
|
|
|
|
CFLAGS += -DMACOSX
|
|
|
|
else
|
|
|
|
ZIPNAME = ../$(TARGET)-$(shell uname -s).zip
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
OBJS = $(SRCS:.c=.o)
|
2021-01-17 21:26:37 -05:00
|
|
|
INCBIN = ../dist/boot.bin ../dist/bootboot.bin ../dist/bootboot.efi ../dist/bootboot.img ../dist/bootboot.rv64 ../aarch64-rpi/LICENCE.broadcom ../aarch64-rpi/bootcode.bin ../aarch64-rpi/fixup.dat ../aarch64-rpi/start.elf
|
2020-06-18 05:17:49 -04:00
|
|
|
|
|
|
|
all: data.c $(TARGET)
|
|
|
|
|
2020-09-22 11:09:44 -04:00
|
|
|
data.c: $(INCBIN)
|
2020-11-08 14:14:06 -05:00
|
|
|
$(CC) bin2h.c -o bin2h
|
2020-06-18 05:17:49 -04:00
|
|
|
./bin2h $(INCBIN) >data.c
|
|
|
|
@rm bin2h
|
|
|
|
|
2020-06-19 23:00:46 -04:00
|
|
|
zlib.o: zlib.c zlib.h
|
|
|
|
$(CC) $(CFLAGS) -Wno-implicit-fallthrough zlib.c -c -o zlib.o
|
|
|
|
|
2020-06-18 05:17:49 -04:00
|
|
|
%: %.c
|
|
|
|
$(CC) $(CFLAGS) $< -c $@
|
|
|
|
|
|
|
|
$(TARGET): $(OBJS)
|
|
|
|
$(CC) $(OBJS) -o $(TARGET) $(LIBDIRS) $(LIBS)
|
2020-06-19 23:00:46 -04:00
|
|
|
@zip $(ZIPNAME) $(TARGET)* DESCRIPT.ION
|
2020-06-18 05:17:49 -04:00
|
|
|
|
|
|
|
clean:
|
2020-06-19 23:00:46 -04:00
|
|
|
@rm $(TARGET)* *.o 2>/dev/null || true
|
2020-06-18 05:17:49 -04:00
|
|
|
|