We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 80a01a3 commit 2c6e9dbCopy full SHA for 2c6e9db
Makefile
@@ -0,0 +1,28 @@
1
+CC=gcc
2
+EXEC=test
3
+LIB=argparse.a
4
+SHARED_LIB=libargparse.so
5
+SOURCE=argparse.c
6
+INCLUDE=argparse.h
7
+TEST_S=test.c
8
+CFLAGS=-fPIC -O2
9
+
10
+all: shared static
11
12
+object:
13
+ $(CC) -c -o $(SOURCE:.c=.o) $(CFLAGS) $(SOURCE)
14
15
+static: object
16
+ ar rcs $(LIB) $(SOURCE:.c=.o)
17
+shared: object
18
+ gcc -shared -o $(SHARED_LIB) $(SOURCE:.c=.o)
19
20
+clean:
21
+ rm -f $(SHARED_LIB) $(LIB) $(SOURCE:.c=.o)
22
23
+install:
24
+ cp $(INCLUDE) /usr/include
25
+ cp $(SHARED_LIB) /usr/lib/$(SHARED_LIB) 2>/dev/null || :
26
+ cp $(LIB) /usr/lib/$(LIB) 2>/dev/null || :
27
+ chmod 0755 /usr/lib/$(LIB) $(SHARED_LIB)
28
+ ldconfig
0 commit comments