-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (34 loc) · 920 Bytes
/
Makefile
File metadata and controls
48 lines (34 loc) · 920 Bytes
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
37
38
39
40
41
42
43
44
45
46
47
48
LIBC ?= /opt/diet/lib-x86_64/libc.a
obj = $(patsubst src/%.c,%.o,$(wildcard src/*.c))
headers = src/scalp.h config.h
mobj = scalp.o itoa.o $(obj)
tobj = test/test.o itoa.o $(obj)
CFLAGS += -Wall
LDFLAGS ?= -static
LDFLAGS += -s -z norelro -z noseparate-code
LD ?= ld
build: scalp
check: test/test
@cd test/ ; ./test
config.h: config.def.h
cp -i config.def.h config.h
@echo "To change the configuration, edit config.h"
config: config.h
itoa.o: src/Itoa
make -C src/Itoa
ln -f src/Itoa/itoa.o itoa.o
test/test.o $(obj): %.o: src/%.c $(headers)
$(CC) -c -o $@ $<
scalp: $(mobj) $(LIBC)
@echo $(obj)
$(LD) $(LDFLAGS) -o $@ $^
test/test: $(tobj) $(LIBC)
$(LD) $(LDFLAGS) -o $@ $^
clean:
rm -f scalp test/test *.o test/*.o Itoa/itoa.o
rm -i config.h
install: scalp
install scalp /usr/bin/
install scalp.1 /usr/share/man/man1/
.PHONY: config build check install clean
all: build check install clean