Commit b8191e58 authored by Romuald Conty's avatar Romuald Conty

MacOSX users can now use autotoolized version.

parent 536268c2
###############################################
# Mac OS X settings
###############################################
LIBPCSC_HEADERS=-I/System/Library/Frameworks/PCSC.framework/Headers
LIBPCSC_LIB=-framework PCSC
LIBUSB_HEADERS=`libusb-config --cflags`
LIBUSB_LIB=`libusb-config --libs`
LIBNFC_TYPE=dylib
LIBNFC_CFLAGS=-dynamiclib
LIBNFC_LINK=
###############################################
# General settings
###############################################
LIBNFC_LDFLAGS=$(LIBPCSC_LIB) $(LIBUSB_LIB)
LIBNFC_PATH=..
VPATH=$(LIBNFC_PATH)
###############################################
# Compiler settings
###############################################
CC = gcc
LD = gcc
CFLAGS = -fPIC -Wall -O4 $(LIBPCSC_HEADERS) $(LIBUSB_HEADERS)
LDFLAGS = -fPIC -Wall -O4
OBJS = dev_pn531.o dev_pn533.o dev_acr122.o dev_arygon.o bitutils.o libnfc.o rs232.o
HEADERS = devices.h bitutils.h defines.h libnfc.h
LIBNFC = libnfc.$(LIBNFC_TYPE)
EXES = anticol emulate list mftool relay
all: $(LIBNFC) $(EXES)
libnfc.$(LIBNFC_TYPE): $(OBJS)
$(LD) $(LDFLAGS) -o $(LIBNFC) $(LIBNFC_CFLAGS) $(LIBNFC_LDFLAGS) $(OBJS)
% : %.c $(LIBNFC)
$(LD) $(LDFLAGS) -o $@ $< -L. -lnfc $(LIBNFC_LINK)
clean:
rm -f $(OBJS) $(LIBNFC) $(EXES)
......@@ -19,37 +19,6 @@ else
echo "Autotooled archive (GNU/Linux, BSD, etc.) is already done: skipped."
fi
# MacOSX part (will be removed if we can use autotools under MacOSX)
LIBNFC_MACOSX_DIR=libnfc-$LIBNFC_VERSION-macosx
LIBNFC_MACOSX_ARCHIVE=$LIBNFC_MACOSX_DIR.tgz
if [ ! -f $LIBNFC_MACOSX_ARCHIVE ]; then
if [ -d $LIBNFC_MACOSX_DIR ]; then
rm -rf $LIBNFC_MACOSX_DIR
fi
mkdir -p $LIBNFC_MACOSX_DIR
# Copy sources
cp src/*.c $LIBNFC_MACOSX_DIR/
cp src/*.h $LIBNFC_MACOSX_DIR/
# Copy important files
cp LICENSE $LIBNFC_MACOSX_DIR/
cp README $LIBNFC_MACOSX_DIR/
# Copy MacOSX specific files
cp macosx/* $LIBNFC_MACOSX_DIR/
# Fix MacOSX Makefile
sed -i 's/LIBNFC_PATH=\.\./LIBNFC_PATH=./' Makefile
# Build archive
tar cvzf $LIBNFC_MACOSX_DIR.tgz $LIBNFC_MACOSX_DIR
rm -rf $LIBNFC_MACOSX_DIR
else
echo "MacOSX archive is already done: skipped."
fi
# Windows part
LIBNFC_WINDOWS_DIR=libnfc-$LIBNFC_VERSION-windows
LIBNFC_WINDOWS_ARCHIVE=$LIBNFC_WINDOWS_DIR.zip
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment