-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
71 lines (59 loc) · 998 Bytes
/
Copy pathMakefile
File metadata and controls
71 lines (59 loc) · 998 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Copyright 2022 Mark Seminatore. All rights reserved.
TARGET = crtl_test
LINKER = cc -o
LIBNAME = libcrtl.a
#CFLAGS += -g -O2 #-D_DEBUG #-DNDEBUG
CFLAGS += -I. -g
LIBS =
DEPS = \
malloc/mm.h \
math.h \
string.h \
stddef.h \
assert.h \
stdio.h \
stdlib.h \
ctype.h \
testy/test.h \
unistd.h \
stdint.h \
errno.h \
limits.h \
config.h \
stdarg.h
OBJS = \
malloc/mm.o \
math.o \
string.o \
assert.o \
errno.o \
stdio.o \
stdlib.o \
ctype.o \
syscall.o \
unistd.o
TEST_OBJS = \
test_string.o \
test_stdlib.o \
test_stdio.o \
test_math.o \
test_main.o \
testy/test_main.o \
test_ctype.o
%.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
all: $(LIBNAME) $(TARGET)
$(LIBNAME): $(OBJS)
ar rcs $(LIBNAME) $(OBJS)
$(TARGET): $(LIBNAME) $(TEST_OBJS)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
test: $(TARGET)
./$(TARGET)
test-release:
$(MAKE) clean
$(MAKE) CFLAGS="-I. -g -DNDEBUG"
./$(TARGET)
$(MAKE) clean
$(MAKE) CFLAGS="-I. -g"
clean:
rm -f $(OBJS) $(TEST_OBJS) $(TARGET) $(LIBNAME) malloc/mm.o