Permalink
Browse files

Add a very simple Makefile (based on build.sh)

  • Loading branch information...
1 parent 281bb65 commit 77abcaf1cf5aeef6b6f30e42c7c544339269df08 Matt Sanford ext:(%22) committed Oct 27, 2011
Showing with 41 additions and 2 deletions.
  1. +39 −0 Makefile
  2. +2 −2 example.cc
View
@@ -0,0 +1,39 @@
+
+CFLAGS=-fPIC -I. -O2 -DCLD_WINDOWS
+LDFLAGS=-L.
+CC=g++
+AR=ar
+
+SOURCES=encodings/compact_lang_det/cldutil.cc \
+ encodings/compact_lang_det/cldutil_dbg_empty.cc \
+ encodings/compact_lang_det/compact_lang_det.cc \
+ encodings/compact_lang_det/compact_lang_det_impl.cc \
+ encodings/compact_lang_det/ext_lang_enc.cc \
+ encodings/compact_lang_det/getonescriptspan.cc \
+ encodings/compact_lang_det/letterscript_enum.cc \
+ encodings/compact_lang_det/tote.cc \
+ encodings/compact_lang_det/generated/cld_generated_score_quadchrome_0406.cc \
+ encodings/compact_lang_det/generated/compact_lang_det_generated_cjkbis_0.cc \
+ encodings/compact_lang_det/generated/compact_lang_det_generated_ctjkvz.cc \
+ encodings/compact_lang_det/generated/compact_lang_det_generated_deltaoctachrome.cc \
+ encodings/compact_lang_det/generated/compact_lang_det_generated_quadschrome.cc \
+ encodings/compact_lang_det/win/cld_htmlutils_windows.cc \
+ encodings/compact_lang_det/win/cld_unilib_windows.cc \
+ encodings/compact_lang_det/win/cld_utf8statetable.cc \
+ encodings/compact_lang_det/win/cld_utf8utils_windows.cc \
+ encodings/internal/encodings.cc \
+ languages/internal/languages.cc
+
+test: example
+ ./example
+
+example: libcld.a example.cc
+ $(CC) -DCLD_WINDOWS -I. -L. -o example example.cc -lcld -lstdc++
+
+libcld.a: $(SOURCES)
+ $(CC) -c $(CFLAGS) $(SOURCES)
+ $(AR) rcs libcld.a *.o
+
+clean:
+ rm -f *.o libcld.a example
+
View
@@ -74,7 +74,7 @@ int main(int argc, char **argv) {
normalized_score3,
&text_bytes,
&is_reliable);
- printf("LANG=%s\n", LanguageName(lang));
+ printf("----[ Text (detected: %s) ]----\n%s\n", LanguageName(lang), src);
src = kTeststr_ks;
lang = CompactLangDet::DetectLanguage(0,
@@ -91,5 +91,5 @@ int main(int argc, char **argv) {
normalized_score3,
&text_bytes,
&is_reliable);
- printf("LANG=%s\n", LanguageName(lang));
+ printf("----[ Text (detected: %s) ]----\n%s\n", LanguageName(lang), src);
}

0 comments on commit 77abcaf

Please sign in to comment.