diff --git a/.gitignore b/.gitignore index d9444128f..335ac5e65 100644 --- a/.gitignore +++ b/.gitignore @@ -5,9 +5,13 @@ tags gh-pages site *.tests +<<<<<<< HEAD lib/.CC lib/.DEF lib/.LN +======= +lib/*.conf +>>>>>>> added a simple config script test/*_test test/*.jpg test/*.png @@ -30,3 +34,4 @@ data/* tool/* config.mk build +Thumbs.db diff --git a/bin/Makefile.mk b/bin/Makefile.mk new file mode 100644 index 000000000..025235479 --- /dev/null +++ b/bin/Makefile.mk @@ -0,0 +1,34 @@ +CC = gcc +CXXFLAGS = -mno-cygwin -O3 -msse2 -Wall -std=c99 -fms-extensions -pedantic -I"../lib" +LDFLAGS = -L"../lib" -L"/strawberry/c/lib" -lccv -ljpeg -lpng -lz -lm -lws2_32 + +o = .o +a = .a + +RM_F = del + +.SUFFIXES : .c .i $(o) .dll $(a) .exe .rc .res + +.PHONY : all .exe + +TARGETS = bbffmt siftmatch bbfcreate bbfdetect swtdetect swtcreate dpmdetect + +# Currently broken +# convert + +all: ../lib/libccv.a $(TARGETS) + +clean: + $(RM_F) *$o ../lib/*$o ../lib/3rdparty/*$o ../lib/libccv$a $(TARGETS) + +$(TARGETS) : $(TARGETS:+".exe") + +@echo. + +%.exe : %.o '../lib/libccv.a' + $(CC) $< -o $@ $(LDFLAGS) + +../lib/libccv.a: ../lib/ccv.h + +cd ..\lib && $(MAKE) libccv.a + +%.o: %.c '../lib/ccv.h' + $(CC) $(CXXFLAGS) -c $< -o $@ diff --git a/bin/dpmcreate.c b/bin/dpmcreate.c index 79b2e831b..6316283fe 100644 --- a/bin/dpmcreate.c +++ b/bin/dpmcreate.c @@ -5,6 +5,7 @@ void exit_with_help() { printf( +<<<<<<< HEAD "\n \033[1mUSAGE\033[0m\n\n dpmcreate [OPTION...]\n\n" " \033[1mREQUIRED OPTIONS\033[0m\n\n" " --positive-list : text file contains a list of positive files in format:\n" @@ -30,6 +31,31 @@ void exit_with_help() " --grayscale : 0 or 1, whether to exploit color in a given image [DEFAULT TO 0]\n" " --discard-estimating-constant : 0 or 1, when estimating bounding boxes, discarding constant (which may be accumulated error) [DEFAULT TO 1]\n" " --percentile-breakdown : 0.00 - 1.00, the percentile use for breakdown threshold [DEFAULT TO 0.05]\n\n" +======= + "\033[1mUSAGE\033[0m\n\tdpmcreate [OPTION...]\n\n" + "\033[1mREQUIRED OPTIONS\033[0m\n" + "\t--positive-list : text file contains a list of positive files in format:\n" + "\t x y width height \\newline\n" + "\t--background-list : text file contains a list of image files that don't contain any target objects\n" + "\t--negative-count : the number of negative examples we should collect from background files to initialize SVM\n" + "\t--model-component : the number of root filters in our mixture model\n" + "\t--model-part : the number of part filters for each root filter\n" + "\t--working-dir : the directory to save progress and produce result model\n" + "\t--symmetric : 0 or 1, whether to exploit symmetric property of the object\n\n" + "\033[1mOTHER OPTIONS\033[0m\n" + "\t--base-dir : change the base directory so that the program can read images from there\n" + "\t--iterations : how many iterations needed for stochastic gradient descent [DEFAULT TO 20]\n" + "\t--relabels : how many relabel procedure needed [DEFAULT TO 5]\n" + "\t--alpha : the step size for stochastic gradient descent [DEFAULT TO 0.1]\n" + "\t--alpha-ratio : decrease the step size for each iteration [DEFAULT TO 0.9]\n" + "\t--margin-c : the famous C in SVM [DEFAULT TO 0.002]\n" + "\t--balance : to balance the weight of positive examples and negative examples [DEFAULT TO 1.75]\n" + "\t--negative-cache-size : the cache size for negative examples it should be smaller than negative-count and larger than 100 [DEFAULT TO 500]\n" + "\t--include-overlap : the percentage of overlap between expected bounding box and the bounding box from detection. Beyond this threshold, it is ensured to be the same object [DEFAULT TO 0.7]\n" + "\t--exclude-overlap : the percentage of overlap between expected bounding box and the bounding box from detection. Below this threshold, it is ensured to not be the same object [DEFAULT TO 0.5]\n" + "\t--grayscale : 0 or 1, whether to exploit color in a given image [DEFAULT TO 1]\n" + "\t--percentile-breakdown : 0.00 - 1.00, the percentile use for breakdown threshold [DEFAULT TO 0.05]\n" +>>>>>>> added a simple config script ); exit(-1); } @@ -70,6 +96,7 @@ int main(int argc, char** argv) char* base_dir = 0; int negative_count = 0; ccv_dpm_param_t detector = { .interval = 8, .min_neighbors = 0, .flags = 0, .threshold = 0.0 }; +<<<<<<< HEAD ccv_dpm_new_param_t params = { .components = 0, .detector = detector, @@ -91,6 +118,25 @@ int main(int argc, char** argv) .grayscale = 0, .discard_estimating_constant = 1, }; +======= + ccv_dpm_new_param_t params = { .components = 0, + .detector = detector, + .parts = 0, + .min_area = 3000, + .max_area = 5000, + .symmetric = 1, + .alpha = 0.1, + .balance = 1.75, + .alpha_ratio = 0.9, + .iterations = 20, + .relabels = 5, + .negative_cache_size = 500, + .C = 0.002, + .percentile_breakdown = 0.05, + .include_overlap = 0.7, + .exclude_overlap = 0.1, + .grayscale = 0 }; +>>>>>>> added a simple config script int i, k; while (getopt_long_only(argc, argv, "", dpm_options, &k) != -1) { diff --git a/bin/make.bat b/bin/make.bat new file mode 100644 index 000000000..485099ca7 --- /dev/null +++ b/bin/make.bat @@ -0,0 +1,16 @@ +cd ..\lib +call make + +cd /d %~dp0 + +set CC=gcc +set CXXFLAGS=-mno-cygwin -O3 -msse2 -Wall -std=c99 -fms-extensions -pedantic -I"../lib" +set LDFLAGS= -L"../lib" -lccv -ljpeg -lpng -lz -lm -I"../lib" -msse2 + +del *.exe +del *.o + +%CC% siftmatch.c -o siftmatch.o -c %CXXFLAGS% +%CC% -o siftmatch.exe siftmatch.o %LDFLAGS% + +siftmatch.exe ..\samples\scene.png ..\samples\book.png \ No newline at end of file diff --git a/bin/makefile b/bin/makefile index 24974ad69..566dd26bb 100644 --- a/bin/makefile +++ b/bin/makefile @@ -1,4 +1,10 @@ +<<<<<<< HEAD include ../lib/config.mk +======= +CC = `cat ../lib/.cc.conf` +LDFLAGS = -L"../lib" -lccv `cat ../lib/.l.conf` -lm +CFLAGS = -O3 -Wall -I"../lib" `cat ../lib/.def.conf` +>>>>>>> added a simple config script #CC += -faddress-sanitizer -fno-omit-frame-pointer LDFLAGS := -L"../lib" -lccv $(LDFLAGS) diff --git a/lib/3rdparty/sha1/sha1.c b/lib/3rdparty/sha1/sha1.c index 5bcb3de6a..bb6307a25 100644 --- a/lib/3rdparty/sha1/sha1.c +++ b/lib/3rdparty/sha1/sha1.c @@ -8,7 +8,12 @@ /* this is only to get definitions for memcpy(), ntohl() and htonl() */ #include +#include +#ifdef WIN32 +#include +#else #include +#endif #include "sha1.h" diff --git a/lib/3rdparty/sha1/sha1.h b/lib/3rdparty/sha1/sha1.h index b864df623..8eb10348c 100644 --- a/lib/3rdparty/sha1/sha1.h +++ b/lib/3rdparty/sha1/sha1.h @@ -5,6 +5,8 @@ * This was initially based on the Mozilla SHA1 implementation, although * none of the original Mozilla code remains. */ +#ifndef GUARD_sha1_h +#define GUARD_sha1_h typedef struct { unsigned long long size; @@ -20,3 +22,5 @@ void blk_SHA1_Final(unsigned char hashout[20], blk_SHA_CTX *ctx); #define git_SHA1_Init blk_SHA1_Init #define git_SHA1_Update blk_SHA1_Update #define git_SHA1_Final blk_SHA1_Final + +#endif \ No newline at end of file diff --git a/lib/Makefile.mk b/lib/Makefile.mk new file mode 100644 index 000000000..d1bcaf534 --- /dev/null +++ b/lib/Makefile.mk @@ -0,0 +1,76 @@ +CC = gcc +# CFLAGS = -Wall -D HAVE_LIBJPEG -D HAVE_CBLAS -D HAVE_GSL -D HAVE_LIBPNG -D HAVE_FFTW3 +DEFINES = -DWIN32 -D HAVE_LIBJPEG -D HAVE_LIBPNG +LIBFILES = -lws2_32 -ljpeg -lpng +INCLUDES = +OPTIMIZE = -O3 -msse2 -Wall -fms-extensions -mms-bitfields + +CFLAGS = $(INCLUDES) $(DEFINES) $(OPTIMIZE) +LINK32 = g++ +LIB32 = ar rc +#AR = ar +LD = g++.exe +#RM_F = rm -f +RM_F = del + +SO = dll +_EXE = .exe +o = .o +a = .a + +LDFLAGS=$(LIBFILES) -Wl,--output-def,ccv.def,--out-lib,libccv.a + +# Handy lists of source code files: +C_FILES = ccv_algebra.c \ + ccv_basic.c \ + ccv_bbf.c \ + ccv_cache.c \ + ccv_daisy.c \ + ccv_dpm.c \ + ccv_io.c \ + io/_ccv_io_binary.c \ + io/_ccv_io_bmp.c \ + io/_ccv_io_libpng.c \ + io/_ccv_io_libjpeg.c \ + ccv_memory.c \ + ccv_numeric.c \ + ccv_sift.c \ + ccv_sparse_coding.c \ + ccv_swt.c \ + ccv_util.c \ + 3rdparty/sha1.c + +O_FILES = ccv_algebra.o \ + ccv_basic.o \ + ccv_bbf.o \ + ccv_cache.o \ + ccv_daisy.o \ + ccv_dpm.o \ + ccv_io.o \ + ccv_memory.o \ + ccv_numeric.o \ + ccv_sift.o \ + ccv_sparse_coding.o \ + ccv_swt.o \ + ccv_util.o \ + 3rdparty/sha1.o + +H_FILES = ccv.h 3rdparty/sha1.h + +all: libccv.a + +clean: + $(RM_F) *.o 3rdparty/*.o libccv.a + +libccv.a: $(O_FILES) + $(AR) rcs $@ $< + +ccv.$(SO): libccv.a + gcc -shared -o ccv.$(SO) $(O_FILES) $(LDFLAGS) + +.c$(o): + $(CC) -c $(null,$(<:d) $(NULL) -I$(<:d)) $(CFLAGS) -o$@ $< + +$(o).dll: + $(LINK32) -o $@ $(BLINK_FLAGS) $< $(LIBFILES) + $(IMPLIB) --input-def $(*B).def --output-lib $(*B).a $@ diff --git a/lib/ccv.def b/lib/ccv.def new file mode 100644 index 000000000..b43f1ac0b --- /dev/null +++ b/lib/ccv.def @@ -0,0 +1,92 @@ +EXPORTS + _ccv_filter_direct_8u @1 + _ccv_flip_x_self @2 + _ccv_flip_y_self @3 + _ccv_get_sparse_prime @4 DATA + _ccv_indice_double_sort @5 + _ccv_indice_float_sort @6 + _ccv_indice_int_sort @7 + _ccv_indice_uchar_sort @8 + _ccv_sort_32f @9 + _ccv_sort_letters @10 + _ccv_swt_connected_component @11 + blk_SHA1_Final @12 + blk_SHA1_Init @13 + blk_SHA1_Update @14 + ccv_array_clear @15 + ccv_array_free @16 + ccv_array_group @17 + ccv_array_new @18 + ccv_array_push @19 + ccv_array_zero @20 + ccv_bbf_classifier_cascade_free @21 + ccv_bbf_classifier_cascade_new @22 + ccv_bbf_classifier_cascade_read_binary @23 + ccv_bbf_classifier_cascade_write_binary @24 + ccv_bbf_detect_objects @25 + ccv_blur @26 + ccv_cache_cleanup @27 + ccv_cache_close @28 + ccv_cache_delete @29 + ccv_cache_get @30 + ccv_cache_init @31 + ccv_cache_out @32 + ccv_cache_put @33 + ccv_canny @34 + ccv_compress_sparse_matrix @35 + ccv_contour_free @36 + ccv_contour_new @37 + ccv_contour_push @38 + ccv_daisy @39 + ccv_decompress_sparse_matrix @40 + ccv_dense_matrix @41 + ccv_dense_matrix_new @42 + ccv_dense_matrix_renew @43 + ccv_disable_cache @44 + ccv_dpm_classifier_lsvm_new @45 + ccv_dpm_detect_objects @46 + ccv_drain_cache @47 + ccv_eigen @48 + ccv_enable_cache @49 + ccv_enable_default_cache @50 + ccv_filter @51 + ccv_filter_kernel @52 + ccv_flip @53 + ccv_gemm @54 + ccv_get_dense_matrix @55 + ccv_get_sparse_matrix @56 + ccv_get_sparse_matrix_cell @57 + ccv_get_sparse_matrix_vector @58 + ccv_gradient @59 + ccv_hog @60 + ccv_invert @61 + ccv_load_bbf_classifier_cascade @62 + ccv_load_dpm_root_classifier @63 + ccv_matrix_eq @64 + ccv_matrix_free @65 + ccv_matrix_free_immediately @66 + ccv_matrix_generate_signature @67 + ccv_minimize @68 + ccv_move @69 + ccv_norm @70 + ccv_normalize @71 + ccv_otsu @72 + ccv_resample @73 + ccv_sample_down @74 + ccv_sample_up @75 + ccv_serialize @76 + ccv_set_sparse_matrix_cell @77 + ccv_shift @78 + ccv_sift @79 + ccv_slice @80 + ccv_sobel @81 + ccv_solve @82 + ccv_sparse_coding @83 + ccv_sparse_matrix_new @84 + ccv_substract @85 + ccv_sum @86 + ccv_swt @87 + ccv_swt_detect_words @88 + ccv_trace @89 + ccv_unserialize @90 + ccv_zero @91 diff --git a/lib/ccv.dll b/lib/ccv.dll new file mode 100644 index 000000000..77883a4ba Binary files /dev/null and b/lib/ccv.dll differ diff --git a/lib/ccv.h b/lib/ccv.h index 18fa832a9..53637a0b0 100644 --- a/lib/ccv.h +++ b/lib/ccv.h @@ -6,8 +6,10 @@ #ifndef GUARD_ccv_h #define GUARD_ccv_h +#ifndef _MSC_VER #include #include +#endif #include #include #include @@ -18,7 +20,11 @@ #include #endif #include +#ifdef _WIN32 +#include +#else #include +#endif #define CCV_PI (3.141592653589793) #define ccmalloc malloc diff --git a/lib/ccv_bbf.c b/lib/ccv_bbf.c index 5354c797f..18f14201a 100644 --- a/lib/ccv_bbf.c +++ b/lib/ccv_bbf.c @@ -5,6 +5,7 @@ #include #include #endif +#include #ifdef USE_OPENMP #include #endif diff --git a/lib/ccv_dpm.c b/lib/ccv_dpm.c index fa5c5f0a7..382dcf291 100644 --- a/lib/ccv_dpm.c +++ b/lib/ccv_dpm.c @@ -1,11 +1,13 @@ #include "ccv.h" #include "ccv_internal.h" -#include #ifdef HAVE_GSL #include #include #include #endif +#ifndef _WIN32 +#include +#endif #ifdef USE_OPENMP #include #endif @@ -1015,6 +1017,18 @@ static void _ccv_dpm_collect_from_background(ccv_array_t* av, gsl_rng* rng, char } static void _ccv_dpm_initialize_root_rectangle_estimator(ccv_dpm_mixture_model_t* model, char** posfiles, ccv_rect_t* bboxes, int posnum, ccv_dpm_new_param_t params) +{ + int i; + for (i = 0; i < posnum; i++) + { + ccv_dense_matrix_t* image = 0; + ccv_read(posfiles[i], &image, (params.grayscale ? CCV_IO_GRAY : 0) | CCV_IO_ANY_FILE); + ccv_dpm_feature_vector_t* v = _ccv_dpm_collect_best(image, model, bboxes[i], params.overlap, params.detector); + ccv_matrix_free(image); + } +} + +static void _ccv_dpm_regularize_mixture_model(ccv_dpm_mixture_model_t* model, double regz) { int i, j, k, c; ccv_dpm_feature_vector_t** posv = (ccv_dpm_feature_vector_t**)ccmalloc(sizeof(ccv_dpm_feature_vector_t*) * posnum); diff --git a/lib/ccv_io.c b/lib/ccv_io.c index f36cd6bac..d70e9682a 100644 --- a/lib/ccv_io.c +++ b/lib/ccv_io.c @@ -12,6 +12,9 @@ #include #else // Unsupported platform +#include +#include +#include #endif #else #include @@ -42,6 +45,10 @@ static int _ccv_read_and_close_fd(FILE* fd, ccv_dense_matrix_t** x, int type) type = CCV_IO_BMP_FILE; else if (memcmp(sig, "CCVBINDM", 8) == 0) type = CCV_IO_BINARY_FILE; + else { + printf("Unknown file signature in '%s'\n", sig); + exit(1); // XXX make exit/return gracefull later + }; fseek(fd, 0, SEEK_SET); } switch (type & 0XFF) diff --git a/lib/configure b/lib/configure index 37c8cdb07..274185ef2 100755 --- a/lib/configure +++ b/lib/configure @@ -1,3 +1,4 @@ +<<<<<<< HEAD #!/usr/bin/env bash if [ "$1" = "force" ] ; then @@ -221,3 +222,91 @@ LDFLAGS="${LDFLAGS#"${LDFLAGS%%[![:space:]]*}"}" LDFLAGS="${LDFLAGS%"${LDFLAGS##*[![:space:]]}"}" echo -e "\n \033[1mUSE\033[m: \033[4m$CC\033[m\n \033[1mCOMPILE FLAGS\033[m: \033[4m$CFLAGS\033[m\n \033[1mLINK FLAGS\033[m: \033[4m$LDFLAGS\033[m\n" +======= +#!/usr/bin/env sh + +if [ "$1" = "force" ] ; then + rm -f .cc.conf .def.conf .l.conf +fi + +if [ -e .cc.conf ] ; then + CC=`cat .cc.conf` +else + read -p "default compiler: clang [Y/n] ? " yn + case $yn in + [nN]* ) read -p "your favorite compiler: " CC + break;; + * ) CC='clang' + break;; + esac + echo $CC > .cc.conf +fi + +if [ -e .def.conf -a -e .l.conf ] ; then + CFLAGS=`cat .def.conf` + LDFLAGS=`cat .l.conf` +else + CFLAGS="" + LDFLAGS="" + read -p "with SSE2 [Y/n] ? " yn + case $yn in + [nN]* ) break;; + * ) CFLAGS="$CFLAGS-msse2 " + break;; + esac + read -p "with libjpeg [Y/n] ? " yn + case $yn in + [nN]* ) break;; + * ) CFLAGS="$CFLAGS-D HAVE_LIBJPEG " + LDFLAGS="$LDFLAGS-ljpeg " + break;; + esac + read -p "with libpng [Y/n] ? " yn + case $yn in + [nN]* ) break;; + * ) CFLAG="$CFLAGS-D HAVE_LIBPNG " + LDFLAGS="$LDFLAGS-lpng -lz " + break;; + esac + read -p "with gsl [Y/n] ? " yn + case $yn in + [nN]* ) break;; + * ) CFLAGS="$CFLAGS-D HAVE_GSL " + LDFLAGS="$LDFLAGS-lgsl " + break;; + esac + read -p "with fftw3 [Y/n] ? " yn + case $yn in + [nN]* ) break;; + * ) CFLAGS="$CFLAGS-D HAVE_FFTW3 " + LDFLAGS="$LDFLAGS-lfftw3f -lfftw3 " + break;; + esac + + read -p "with liblinear [Y/n] ? " yn + case $yn in + [nN]* ) break;; + * ) CFLAGS="$CFLAGS-D HAVE_LIBLINEAR " + LDFLAGS="$LDFLAGS-llinear " + break;; + esac + read -p "with cblas [Y/n] ? " yn + case $yn in + [nN]* ) break;; + * ) CFLAGS="$CFLAGS-D HAVE_CBLAS " + LDFLAGS="$LDFLAGS-lblas " + break;; + esac + read -p "use openmp [y/N] ? " yn + case $yn in + [yY]* ) CFLAGS="$CFLAGS-D USE_OPENMP -fopenmp " + LDFLAGS="$LDFLAGS-lgomp " + break;; + * ) break;; + esac + echo $CFLAGS > .def.conf + echo $LDFLAGS > .l.conf +fi + +echo "\nsummary:\nuse: $CC\nwith following compile flags:\n$CFLAGS\nand link flags:\n$LDFLAGS\n" +>>>>>>> added a simple config script diff --git a/lib/make.bat b/lib/make.bat new file mode 100644 index 000000000..4cb9ef062 --- /dev/null +++ b/lib/make.bat @@ -0,0 +1,22 @@ +set CCFLAGS=-O3 -msse2 -Wall -std=c99 -fms-extensions -pedantic -DHAVE_LIBPNG -DHAVE_LIBJPEG -DWIN32 + +del *.o +del *.dll +del *.a + +gcc %CCFLAGS% -c ccv_sift.c -o ccv_sgf.o +gcc %CCFLAGS% -c ccv_basic.c -o ccv_basic.o +gcc %CCFLAGS% -c ccv_algebra.c -o ccv_algebra.o +gcc %CCFLAGS% -c ccv_bbf.c -o ccv_bbf.o +gcc %CCFLAGS% -c ccv_cache.c -o ccv_cache.o +gcc %CCFLAGS% -c ccv_daisy.c -o ccv_daisy.o +gcc %CCFLAGS% -c ccv_dpm.c -o ccv_dpm.o +gcc %CCFLAGS% -c ccv_memory.c -o ccv_memory.o +gcc %CCFLAGS% -c ccv_util.c -o ccv_util.o +gcc %CCFLAGS% -c ccv_numeric.c -o ccv_numeric.o +gcc %CCFLAGS% -c ccv_io.c -o ccv_io.o +gcc %CCFLAGS% -c ccv_swt.c -o ccv_swt.o +gcc %CCFLAGS% -c 3rdparty/sha1.c -o 3rdparty/sha1.o +gcc -shared -o ccv.dll ccv_cache.o ccv_memory.o 3rdparty/sha1.o ccv_io.o ccv_numeric.o ccv_algebra.o ccv_util.o ccv_basic.o ccv_daisy.o ccv_sgf.o -lws2_32 -ljpeg -lpng -Wl,--output-def,ccv.def,--out-implib,libccv.a +@rem lib /machine:i386 /def:ccv.def +copy /y ccv.dll ..\bin diff --git a/lib/makefile b/lib/makefile index 5282e73ad..60f16ba88 100644 --- a/lib/makefile +++ b/lib/makefile @@ -1,9 +1,22 @@ +<<<<<<< HEAD include config.mk #CC += -faddress-sanitizer -fno-omit-frame-pointer CFLAGS := -O3 -ffast-math -Wall $(CFLAGS)# -fprofile-arcs -ftest-coverage .PHONY: all clean +======= +CC = `cat .cc.conf`# -faddress-sanitizer -fno-omit-frame-pointer +CFLAGS = -O3 -ffast-math -mtune=native -Wall `cat .def.conf` + +config: + @./configure + @make all + +force: clean + @./configure force + @make all +>>>>>>> added a simple config script all: libccv.a diff --git a/test/funct/makefile b/test/funct/makefile new file mode 100644 index 000000000..b33f61f08 --- /dev/null +++ b/test/funct/makefile @@ -0,0 +1,21 @@ +CC = `cat ../../lib/.cc.conf` +LDFLAGS = -L"../../lib" -lccv -pthread `cat ../../lib/.l.conf` +CFLAGS = -O3 -msse2 -Wall -I"../../lib" -I"../" `cat ../../lib/.def.conf` +TARGETS = algebra.tests util.tests numeric.tests basic.tests memory.tests + +test: all + for test in $(TARGETS) ; do ./"$$test" ; done + +all: $(TARGETS) + +clean: + rm *.o ../../lib/*.o ../../lib/3rdparty/*.o ../../lib/libccv.a $(TARGETS) + +%.tests: %.tests.o libccv.a + $(CC) -o $@ $< $(LDFLAGS) + +libccv.a: + ${MAKE} -C ../../lib + +%.o: %.c ../../lib/ccv.h + $(CC) $(INCFLAGS) $< -o $@ -c $(CFLAGS) diff --git a/test/regression/makefile b/test/regression/makefile index 1d9a92e9a..42f30258a 100644 --- a/test/regression/makefile +++ b/test/regression/makefile @@ -1,7 +1,13 @@ +<<<<<<< HEAD include ../../lib/config.mk LDFLAGS := -L"../../lib" -lccv $(LDFLAGS) CFLAGS := -O3 -Wall -I"../../lib" -I"../" $(CFLAGS) +======= +CC = `cat ../../lib/.cc.conf` +LDFLAGS = -L"../../lib" -lccv -pthread `cat ../../lib/.l.conf` +CFLAGS = -O3 -msse2 -Wall -I"../../lib" -I"../" `cat ../../lib/.def.conf` +>>>>>>> added a simple config script TARGETS = defects.l0.1.tests test: all