-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
39 lines (30 loc) · 898 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
CC = g++
CFLAGS = -Wall -g -fpic
RM = /bin/rm -f
CP = /bin/cp -f
CHMOD = /bin/chmod
MKDIR = /bin/mkdir -p
PRINT = @echo
all: parseopt
$(CC) -shared parseopt.o -o libparseopt.so
parseopt: parseopt.h parseopt.cpp
$(CC) $(CFLAGS) -c parseopt.cpp -o parseopt.o
install:
$(PRINT) "Creating destination directories..."
$(MKDIR) /usr/local/include /usr/local/lib
$(CHMOD) 0755 /usr/local/include /usr/local/lib
$(PRINT) "Installing library files..."
$(CP) parseopt.h /usr/local/include
$(CP) libparseopt.so /usr/local/lib
$(CHMOD) 0644 /usr/local/include/parseopt.h /usr/local/lib/libparseopt.so
$(PRINT) "Updating library cache..."
ldconfig
uninstall:
$(PRINT) "Uninstalling library files..."
$(RM) /usr/local/include/parseopt.h /usr/local/lib/libparseopt.so
$(PRINT) "Updating library cache..."
ldconfig
example: example.cpp
$(CC) example.cpp -lparseopt
clean:
$(RM) *.o *.so