summaryrefslogblamecommitdiff
path: root/src/modules/test/Makefile
blob: 105aa5478da4570b6daf21a859b24d1e105a8b99 (plain) (tree)
1
2
3
4
5
6
7
8
9


                       
                                                                                                                

       
                                                   

                
                  














                                     

                               

               

                               
 
.PHONY: clean, mrproper

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

LD = ld
LDFLAGS = -T ../../library/link.ld -L ../../library

Objects = main.o
Outfile = test.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 $(Objects) || exit 0

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