Skip to content

Commit

Permalink
Makes dynamic library
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Lyon and Joshua Davey authored and hashrocketeer committed Jun 9, 2011
1 parent 38ede7c commit 2addfbd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 17 deletions.
12 changes: 6 additions & 6 deletions Makefile
@@ -1,4 +1,4 @@
CC := g++ -Wall -O -g3
CC := g++ -Wall -O -g3 -dynamic -fPIC -fno-common

UTIL_INCLUDE := -I/usr/local/include/ImageMagick -Isrc
UTIL_LIBS = -lMagick++ -lMagickWand -lMagickCore -liconv
Expand All @@ -20,10 +20,10 @@ endef

.PHONY: all checkdirs clean

all: checkdirs build/zxing.a util
all: checkdirs build/zxing.so util

build/zxing.a: $(OBJ)
libtool -o $@ - $^
build/zxing.so: $(OBJ)
g++ -shared -o $@ $^ $(UTIL_LIBS)

checkdirs: $(BUILD_DIR)

Expand All @@ -37,13 +37,13 @@ clean:

install:
mkdir -p lib bin
cp -f build/zxing.a lib/zxing
cp -f build/zxing.so lib/zxing.so
mv -f build/qrdecode bin

$(foreach bdir,$(BUILD_DIR),$(eval $(call make-goal,$(bdir))))

util: main.o MagickBitmapSource.o
$(CC) -o build/qrdecode $(addprefix build/,$^) $(UTIL_LIBS) build/zxing.a
$(CC) -o build/qrdecode $(addprefix build/,$^) $(UTIL_LIBS) build/zxing.so

main.o: main.cpp
$(CC) -c $(UTIL_INCLUDE) -o build/$@ $<
Expand Down
11 changes: 0 additions & 11 deletions src/util/main.cpp
Expand Up @@ -37,17 +37,6 @@
#include <zxing/BinaryBitmap.h>
#include <zxing/DecodeHints.h>

// #include <iostream>
// #include <fstream>
// #include <string>
// #include <Magick++.h>
// #include "MagickBitmapSource.h"
// #include <zxing/Binarizer.h>
// #include <zxing/qrcode/QRCodeReader.h>
// #include <zxing/common/GlobalHistogramBinarizer.h>
// #include <zxing/common/LocalBlockBinarizer.h>
// #include <zxing/Exception.h>

using namespace Magick;
using namespace std;
using namespace zxing;
Expand Down

0 comments on commit 2addfbd

Please sign in to comment.