Modified the linux Makefile to generate a static lib to allow external program to link with crunch
This commit is contained in:
+10
-3
@@ -1,6 +1,8 @@
|
|||||||
COMPILE_OPTIONS = -O3 -fomit-frame-pointer -ffast-math -fno-math-errno -g -fno-strict-aliasing -Wall -Wno-unused-value -Wno-unused -march=core2
|
COMPILE_OPTIONS = -O3 -fomit-frame-pointer -ffast-math -fno-math-errno -g -fPIC -fno-strict-aliasing -Wall -Wno-unused-value -Wno-unused -march=core2
|
||||||
LINKER_OPTIONS = -lpthread -g
|
LINKER_OPTIONS = -lpthread -g
|
||||||
|
|
||||||
|
LIBCRUNCH = libcrunch.a
|
||||||
|
|
||||||
OBJECTS = \
|
OBJECTS = \
|
||||||
crn_arealist.o \
|
crn_arealist.o \
|
||||||
crn_assert.o \
|
crn_assert.o \
|
||||||
@@ -82,6 +84,9 @@ all: crunch
|
|||||||
%.o: %.cpp
|
%.o: %.cpp
|
||||||
g++ $< -o $@ -c $(COMPILE_OPTIONS)
|
g++ $< -o $@ -c $(COMPILE_OPTIONS)
|
||||||
|
|
||||||
|
$(LIBCRUNCH): $(OBJECTS)
|
||||||
|
ar rcs $(LIBCRUNCH) $(OBJECTS)
|
||||||
|
|
||||||
crunch.o: ../crunch/crunch.cpp
|
crunch.o: ../crunch/crunch.cpp
|
||||||
g++ $< -o $@ -c -I../inc -I../crnlib $(COMPILE_OPTIONS)
|
g++ $< -o $@ -c -I../inc -I../crnlib $(COMPILE_OPTIONS)
|
||||||
|
|
||||||
@@ -91,6 +96,8 @@ corpus_gen.o: ../crunch/corpus_gen.cpp
|
|||||||
corpus_test.o: ../crunch/corpus_test.cpp
|
corpus_test.o: ../crunch/corpus_test.cpp
|
||||||
g++ $< -o $@ -c -I../inc -I../crnlib $(COMPILE_OPTIONS)
|
g++ $< -o $@ -c -I../inc -I../crnlib $(COMPILE_OPTIONS)
|
||||||
|
|
||||||
crunch: $(OBJECTS) crunch.o corpus_gen.o corpus_test.o
|
crunch: $(LIBCRUNCH) crunch.o corpus_gen.o corpus_test.o
|
||||||
g++ $(OBJECTS) crunch.o corpus_gen.o corpus_test.o -o crunch $(LINKER_OPTIONS)
|
g++ crunch.o corpus_gen.o corpus_test.o -o crunch $(LIBCRUNCH) $(LINKER_OPTIONS)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf $(LIBCRUNCH) crunch *.o
|
||||||
|
|||||||
Reference in New Issue
Block a user