summaryrefslogtreecommitdiff
path: root/src/modules/manager/Makefile
blob: 87a9590af45a7d9126034831e7363d59baa26b01 (plain) (blame)
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
30
31
32
33
.PHONY: clean, mrproper

CC = gcc
CFLAGS = -nostdlib -nostartfiles -nodefaultlibs -fno-builtin -fno-stack-protector -Wall -Wextra -I ../../include

LD = ld
LDFLAGS = -T ../../library/link.ld -L ../../library -Map manager.map

Objects = main.o
Outfile = manager.elf

all: $(Outfile)
	echo "* Done with $(Outfile)"

rebuild: mrproper all

$(Outfile): $(Objects)
	echo "* Linking $@..."
	$(LD) $(LDFLAGS) -o $@ $^

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

clean:
	echo "* Removing objects..."
	rm *.o || exit 0
	rm *.map || exit 0
	rm $(Objects) || exit 0

mrproper: clean
	rm *.elf || exit 0
	rm $(Outfile) || exit 0