summaryrefslogtreecommitdiff
path: root/Makefile
blob: af28debcb91cb590a2f4f7a43f99fc0f1cecb41d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
CFLAGS  = -Os -pipe -std=c99 -D_POSIX_C_SOURCE=200809L
LDFLAGS =

SRCS = $(sort $(wildcard src/*.c))
DATA = $(sort $(wildcard src/*.bin))
OBJS = $(SRCS:.c=.o) $(DATA:.bin=.o)
BINS = bin/satmkboot

.PHONY: all clean

all: $(BINS)

clean:
	rm -f $(BINS)
	rm -f $(OBJS)

bin/satmkboot:         \
	src/satmkboot.o    \
	src/securitycode.o \
	src/symbols.o

%.c: %.bin
	tools/bin2c $< > $@

%.o: %.c
	$(CC) $(CFLAGS) -c $< -o $@

%:
	$(CC) $(LDFLAGS) $^ -o $@