-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
33 lines (24 loc) · 816 Bytes
/
makefile
File metadata and controls
33 lines (24 loc) · 816 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
COMPILER = gcc
CFLAGS = -Wall -Werror -g -fsanitize=address,undefined
COMPILE_OBJECT = $(COMPILER) $(CFLAGS) -c $< -o $@
libpurpdynarray.a: chararray.o strarray.o strmap.o
ar rcs libpurpdynarray.a $^
main: main.o chararray.o strarray.o strmap.o
$(COMPILER) $(CFLAGS) -o main $^
main.o: main.c chararray.h strarray.h strmap.h
$(COMPILE_OBJECT)
strmap.o: strmap.c strmap.h chararray.h
$(COMPILE_OBJECT)
strarray.o: strarray.c strarray.h chararray.h
$(COMPILE_OBJECT)
chararray.o: chararray.c chararray.h
$(COMPILE_OBJECT)
install:
cp libpurpdynarray.a /usr/local/lib/
ranlib /usr/local/lib/libpurpdynarray.a
cp chararray.h strarray.h /usr/local/include/
uninstall:
rm -f /usr/local/lib/libpurpdynarray.a
rm -f /usr/local/include/chararray.h /usr/local/include/strarray.h
clean:
rm -f *.o *.a main