blob: d4719ac240dd70eb2dd3d957eb23268252f16535 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
LIBNAME = add
all: lib$(LIBNAME).so test$(LIBNAME)
$(LIBNAME).o: $(LIBNAME).h $(LIBNAME).c
gcc -fPIC -c $(LIBNAME).c
lib$(LIBNAME).so: $(LIBNAME).o
gcc -shared -o lib$(LIBNAME).so $(LIBNAME).o
test$(LIBNAME): lib$(LIBNAME).so main.c add.h
gcc -Wall -L$(PWD) -Wl,-rpath=$(PWD) -o $@ main.c -l$(LIBNAME) -g
install:
cp add.h ../thirdparty/linux/include/
cp libadd.so ../thirdparty/linux/lib/x64/
.PHONY: clean
clean:
$(RM) -f *.so *.o test
|