aboutsummaryrefslogtreecommitdiff
path: root/lib/Makefile
blob: 6006be5ba06aed69868ccdac3f58db78edb3c797 (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
# Copyright (c) 2020 Johannes Stoelp

HDR+=include/alloc.h
HDR+=include/auxv.h
HDR+=include/elf.h
HDR+=include/fmt.h
HDR+=include/io.h
HDR+=include/syscall.h
HDR+=include/syscalls.h

DEP+=src/alloc.o
DEP+=src/common.o
DEP+=src/fmt.o
DEP+=src/io.o
DEP+=src/syscalls.o

libcommon.a: $(HDR) $(DEP)
	ar -crs $@ $(filter %.o, $^)

src/%.o: src/%.c
	gcc -c -o $@            \
	    -g -O0              \
	    -Wall -Wextra       \
	    -I$(CURDIR)/include \
	    -nostdlib           \
	    -fno-stack-protector \
	    $<

clean:
	rm -f $(DEP)
	rm -f libcommon.a