summaryrefslogtreecommitdiff
path: root/src/library/Makefile
blob: b0dac11c831d7d0f5aa364f6351ca78322c19a76 (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
34
35
36
.PHONY: clean, mrproper

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

LD = ld
LDFLAGS = -r

Library = grapes.o
Objects = gc/syscall.o gc/object.o \
		  gc/mem.o gc/shm.o \
		  mutex.o \
		  start.o

all: $(Library)
	echo "* Done with library $(Library)"

rebuild: mrproper all

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

%.uo: %.c
	echo "* Compiling $<..."
	$(CC) $(CFLAGS) -c $< -o $@

clean:
	echo "* Removing object files..."
	rm *.o || exit 0
	rm -rf $(Objects) || exit 0

mrproper: clean
	echo "* Removing library..."
	rm *.o || exit 0
	rm -rf $(Library) || exit 0