-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (34 loc) · 1.07 KB
/
Makefile
File metadata and controls
53 lines (34 loc) · 1.07 KB
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
objects := mtime.o mlocaltime.o masctime.o mofftime.o mstrftime.o
platform=$(shell uname -s)
ifeq ($(platform),Darwin)
all: libmtime.a
else
all: libmtime.a libmtime.so
endif
test: all
make -C t
clean:
rm -f libmtime.a libmtime.so* *.o
make -C t clean
libmtime.a: mtime.o ${objects}
ar rs libmtime.a ${objects}
ifeq ($(platform),Darwin)
libmtime.so: ${objects}
ld -shared -soname libmtime.so.1 -o libmtime.so.1.0 ${objects}
ln -fs libmtime.so.1.0 libmtime.so.1
ln -fs libmtime.so.1.0 libmtime.so
endif
mtime.o: mtime.c mtime.h masctime.h mlocaltime.h
gcc -fPIC -c -o mtime.o mtime.c
mofftime.o: mofftime.c mtime.h mtimedefs.h mofftime.h
gcc -fPIC -c -o mofftime.o mofftime.c
masctime.o: masctime.c mtime.h mtimedefs.h masctime.h
gcc -fPIC -c -o masctime.o masctime.c
mlocaltime.o: mlocaltime.c mtime.h mtimedefs.h mlocaltime.h
gcc -fPIC -c -o mlocaltime.o mlocaltime.c
mstrftime.o: mstrftime.c mtime.h mtimedefs.h mstrftime.h
gcc -fPIC -c -o mstrftime.o mstrftime.c
install: all
cp -prad libmtime.* /usr/local/lib
cp -prad mtime.h /usr/local/include
ldconfig