You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

24 lines
892 B

  1. CFLAGS = -g
  2. INCLUDE = -I/usr/local/include -I/usr/include -I.
  3. LIBS = -L /usr/local/lib -larchive
  4. #DEFINES = -DPyUnicode_AS_STRING=PyUnicode_AS_DATA
  5. PYVER ?= 3.9
  6. all: __libarchive.so
  7. _libarchive_wrap.c: _libarchive.i
  8. #swig -python -c++ -Wall -shadow _libarchive.i
  9. swig -python -Wall -shadow _libarchive.i
  10. _libarchive_wrap.o: _libarchive_wrap.c
  11. echo ${CC} -c ${CFLAGS} -fPIC $$(python${PYVER}-config --cflags) _libarchive_wrap.c
  12. ${CC} -c ${CFLAGS} -fPIC $$(python${PYVER}-config --cflags) ${DEFINES} _libarchive_wrap.c
  13. # ${CXX} -c ${CFLAGS} -fPIC $$(python${PYVER}-config --cflags) -DPyUnicode_AS_STRING=PyUnicode_AS_DATA _libarchive_wrap.cxx
  14. __libarchive.so: _libarchive_wrap.o
  15. echo INCLUDE=$INCLUDE LIBS=$LIBS
  16. ${CC} _libarchive_wrap.o -shared $$(python${PYVER}-config --ldflags) -Wl,-soname=__libarchive.so -o __libarchive.so ${LIBS}
  17. clean:
  18. rm -f *.o *.so *.pyc