-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMakefile
46 lines (34 loc) · 831 Bytes
/
Makefile
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
CC=gcc
ifeq ($(BUILD),debug)
# Debug mode: Unoptimized and with debuging symbols
CFLAGS = -Wall -O0 -g -DTEST
#CFLAGS = -Wall -O0 -g
LFLAGS =
else
# Release mode: Optimized and stripped of debugging info
CFLAGS = -Wall -Os -DNDEBUG
LFLAGS = -s -fno-exceptions
endif
SOURCES=main.c musl.c
OBJECTS=$(SOURCES:.c=.o)
# If your system does not have POSIX regular expressions
# (regcomp(), regexec(), etc.) you can remove this line
# to disable the REGEX() built-in function
#CFLAGS += -DWITH_REGEX
all: musl manual.html
debug:
make "BUILD=debug"
musl: $(OBJECTS)
$(CC) -o $@ $(LFLAGS) $(OBJECTS)
.c.o:
$(CC) -c $(CFLAGS) $< -o $@
musl.o : musl.h
main.o : musl.h
manual.html: doc.awk musl.c main.c musl.h
awk -f $^ > $@
.PHONY : clean
clean:
-rm -rf musl musl.exe
-rm -rf *.o
-rm -rf *~ *.tmp
-rm -rf manual.html