summaryrefslogtreecommitdiff
path: root/Makefile
blob: 58625ce0e022cf106fe09007e8d30663a0181506 (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
OBJ=bootstub.o head.o

all: bootstub

bootstub:bootstub.bin
	cat bootstub.bin /dev/zero | dd bs=4096 count=1 > $@

bootstub.bin:bootstub.elf
	objcopy -O binary -R .note -R .comment -S $< $@

bootstub.elf:bootstub.lds $(OBJ)
	ld -m elf_i386 -T bootstub.lds $(OBJ) -o $@

bootstub.o:bootstub.c
	gcc -c bootstub.c

head.o:head.S
	gcc -c head.S

clean:
	rm -rf *.o *.bin *.elf

targz:bootstub.c head.S VERSION
	git-archive --prefix=bootstub-`head -n 1 VERSION | awk '{print $$1}'`/ --format=tar HEAD | gzip -c > bootstub-`head -n 1 VERSION | awk '{print $$1}'`.tar.gz

.PHONY: all clean targz