Karsten Ohme schrieb:
David Corcoran schrieb:
Hi Karsten,
I pretty much use simple Makefiles to build everything now. I found that autoconf/automake, etc was just too much
of a hassle for what it actually provided .....
Could you publish it?
Thanks, Karsten
If someone needs a fast and probably dirty solution for building a Debian libmusclecard.so, he could use this makefile and the handmade config.h while some problems exist and a version is published. Both must be placed in libmusclecard/ There a three targets: help to list all possible targets
clean to clean the directories Debug and Release
and the implicit all
With DEBUG=1 a debug version for debugging purposes (what else) can be built.
Bye, Karsten
.PHONY: clean all create_dirs help tests
# replace with your path to the MuscleCard header files
# or specify on command line
PCSC_INC=./src/PCSC
# replace with your path to the MuscleCard library files
# or specify on command line excluding the Release or Debug directory
PCSC_LIB=/usr/lib
# the name of the library
LIB_NAME=musclecard
# Directory name may not contain spaces
ifdef DEBUG
OUTDIR=Debug
else
OUTDIR=Release
endif
OBJ=$(OUTDIR)/musclecard.o $(OUTDIR)/tokenfactory.o $(OUTDIR)/tokenparser.o
CC=gcc
LD=gcc
ifdef DEBUG
CFLAGS=-c -x c -fPIC -D_REENTRANT -Wall -g -I$(PCSC_INC)
else
CFLAGS=-c -x c -O2 -fPIC -D_REENTRANT -Wall -I$(PCSC_INC)
endif
ifdef DEBUG
LDFLAGS=-o $(OUTDIR)/lib$(LIB_NAME).so -L$(PCSC_LIB) -lpcsclite -shared -fPIC
else
LDFLAGS=-o $(OUTDIR)/lib$(LIB_NAME).so -L$(PCSC_LIB) -lpcsclite -shared -fPIC
endif
all: tests create_dirs ./src/tokenparser.c $(OUTDIR)/lib$(LIB_NAME).so
./src/tokenparser.c : ./src/tokenparser.l
flex -o./src/tokenparser.c ./src/tokenparser.l
tests:
ifeq ($(wildcard $(PCSC_INC)),)
$(error Your path to the header files for PC/SC Lite is wrong. \
Replace it in the Makefile or call nmake with
PCSC_INC=<PATH_TO_PCSC_HEADERS>)
endif
ifeq ($(wildcard $(PCSC_LIB)),)
$(error Your path to the library files for PC/SC Lite \
excluding the Release or Debug directory is wrong \
Replace it in the Makefile or call nmake with
PCSC_LIB=<PATH_TO_PCSC_LIBS>)
endif
create_dirs:
[EMAIL PROTECTED] $(OUTDIR)
# compilation and linking
$(OUTDIR)/lib$(LIB_NAME).so: $(OBJ)
$(LD) $(LDFLAGS) $(OBJ)
$(OBJ):
$(CC) $(CFLAGS) -o $(OUTDIR)/$(*F).o src/$(*F).c
clean:
[EMAIL PROTECTED] -rf Debug
[EMAIL PROTECTED] -rf Release
help:
@echo
@echo Possible Targets:
@echo all - Build release version.
@echo all DEBUG= - Build debug version.
@echo clean - Delete Debug and Release directories
@echo help - Display this help
@echo/* enable client side thread safety. */ #define USE_THREAD_SAFETY 1 #define HAVE_DIRENT_H #define MSC_ARCH "Debian-i386"
_______________________________________________ Muscle mailing list [email protected] http://lists.drizzle.com/mailman/listinfo/muscle
