-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
New directory layout. Closes #4
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# Objects and dependencies. | ||
*.o | ||
*.a | ||
*.d | ||
# Debugging | ||
*.dSYM/ | ||
core |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Change Log | ||
All notable changes to this project will be documented in this file. | ||
This project adheres to [Semantic Versioning](http://semver.org/). | ||
This file is inspired by [Keep a `CHANGELOG`](http://keepachangelog.com/). | ||
|
||
## [Unreleased] | ||
### Added | ||
- `Make exports` which outputs shell `export` commands (to avoid global installation) | ||
|
||
### Changed | ||
- More conventional directory layout (#4) | ||
|
||
## [6.0.0] - 2016-01-04 | ||
### Fixed | ||
- Bug in implementation of [WB6](http://unicode.org/reports/tr29/#WB6) | ||
- Special case U+0020 SPACE ' ' as a graphic character | ||
- Clang warnings | ||
|
||
## [6.0.0] - 2016-01-04 | ||
### Added | ||
- Word segmentation using [Unicode word boundaries](http://unicode.org/reports/tr29/#Word_Boundaries). | ||
|
||
### Changed | ||
- Start following [SemVer](http://semver.org) properly. | ||
- All input and output is in UTF-8 | ||
- Fixes to handle non-BMP code points (code points beyond U+FFFF) | ||
|
||
### Removed | ||
- `uni2asc` and `asc2uni` (redundant due to change to UTF-8) | ||
|
||
## [5.1.3] - 2015-11-15 | ||
### Changed | ||
- More idiomatic `make` build system | ||
|
||
### Fixed | ||
- Compiles on modern OS X and Ubuntu | ||
|
||
[Unreleased]: https://github.com/eddieantonio/isri-ocr-evaluation-tools/compare/v6.0.1...HEAD | ||
[6.0.1]: https://github.com/eddieantonio/isri-ocr-evaluation-tools/compare/v6.0.0...v6.0.1 | ||
[6.0.0]: https://github.com/eddieantonio/isri-ocr-evaluation-tools/compare/v5.1.3...v6.0.0 | ||
[5.1.3]: https://github.com/eddieantonio/isri-ocr-evaluation-tools/compare/v5.1.0...v5.1.3 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,124 @@ | ||
include common.mk | ||
# Copyright 2016 Eddie Antonio Santos <easantos@ualberta.ca> | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Install prefix, if installing globally. | ||
# See also: `exports` target | ||
PREFIX = /usr/local | ||
BINDIR = $(PREFIX)/bin | ||
MANDIR = $(PREFIX)/share/man/man1 | ||
|
||
# List of all the tools (executables + manual pages) | ||
TOOLS = accci accdist accsum accuracy editop editopcost editopsum \ | ||
groupacc ngram nonstopacc synctext vote wordacc wordaccci \ | ||
wordaccdist wordaccsum wordfreq | ||
|
||
PREFIX = /usr/local | ||
BINDIR = $(PREFIX)/bin | ||
MANDIR = $(PREFIX)/share/man/man1 | ||
# Name: libisri, or -lisri | ||
NAME = isri | ||
MAJOR_VERSION = 6 | ||
MINOR_VERSION = 1 | ||
|
||
# All the executables go in bin/ | ||
EXECUTABLES = $(addprefix bin/,$(TOOLS)) | ||
# All manual pages go in share/man/man1 | ||
MANPAGES = $(foreach TOOL,$(TOOLS),share/man/man1/$(TOOL).1) | ||
|
||
include use-libisri-internal.mk | ||
|
||
EXECUTABLES = $(foreach D,$(TOOLS),$D/$D) | ||
MANPAGES = $(EXECUTABLES:=.1) | ||
LIB = Modules | ||
LIBRARY.a = lib/lib$(NAME).a | ||
ifeq ($(shell uname -s),Darwin) | ||
LIBRARY.so = $(LIBRARY.a:.a=.dylib) | ||
else | ||
LIBRARY.so = $(LIBRARY.a:.a=.so.$(MAJOR_VERSION).$(MINOR_VERSION)) | ||
endif | ||
|
||
all: $(TOOLS) | ||
################################################################################ | ||
|
||
# Create every subexecutable. | ||
$(TOOLS): $(LIB) | ||
$(MAKE) -C $@ | ||
# Allows for proper compilation and linking settings for libisri | ||
|
||
$(LIB): Modules/word_break_property.h | ||
$(MAKE) -C $@ | ||
all: $(EXECUTABLES) | ||
|
||
install: install-bin install-man | ||
|
||
install-bin: $(TOOLS) | ||
install-bin: $(EXECUTABLES) | ||
mkdir -p $(BINDIR) | ||
cp $(EXECUTABLES) $(BINDIR)/ | ||
|
||
install-man: $(TOOLS) | ||
install-man: $(MANPAGES) | ||
mkdir -p $(MANDIR) | ||
cp $(MANPAGES) $(MANDIR)/ | ||
|
||
clean: clean-lib clean-execs | ||
# Prints a bunch of exports you can source in your shell's startup file. | ||
exports: | ||
@echo '#' ISRI Evaluation Tools | ||
@echo export PATH='$(TOP)bin:$$PATH' | ||
@echo export MANPATH='$(TOP)share/man:$$MANPATH' | ||
ifeq ($(shell uname -s),Darwin) | ||
@echo export DYLD_LIBRARY_PATH='$(TOP)lib:$$DYLD_LIBRARY_PATH' | ||
else | ||
@echo export LD_LIBRARY_PATH='$(TOP)lib:$$LD_LIBRARY_PATH' | ||
endif | ||
|
||
clean: clean-objs clean-execs clean-libs clean-deps clean-test | ||
|
||
clean-libs: | ||
$(RM) $(LIBRARY.a) $(LIBRARY.so) | ||
|
||
clean-lib: | ||
$(MAKE) -C Modules clean | ||
clean-objs: | ||
$(RM) $(MODULES:.c=.o) | ||
|
||
clean-deps: | ||
$(RM) $(DEPENDENCIES) | ||
|
||
clean-execs: | ||
$(RM) $(EXECUTABLES) | ||
|
||
clean-test: | ||
$(MAKE) -C test clean | ||
|
||
TEST_ARGS = | ||
test: $(LIB) | ||
$(MAKE) -C Tests | ||
test: $(LIBRARY.a) | ||
$(MAKE) -C test | ||
|
||
# Uses https://github.com/alexch/rerun | ||
# $ gem install rerun | ||
watch: | ||
rerun --clear --exit --pattern '**/*.{c,h}' -- make test | ||
|
||
# Generate the include file, required by libisri.a | ||
Modules/word_break_property.h: Supplement/generate_word_break.py Supplement/WordBreakProperty.txt.gz | ||
./$< > $@ | ||
|
||
.PHONY: all clean clean-lib clean-execs install install-bin install-bin | ||
.PHONY: all | ||
.PHONY: install install-bin install-man | ||
.PHONY: clean clean-deps clean-execs clean-lib clean-objs clean-test | ||
.PHONY: test watch | ||
# Always remake subdirs. | ||
.PHONY: $(LIB) $(MODULES) | ||
################################################################################ | ||
|
||
# Executable sources are C files that provide a main() for executables. | ||
EXECUTABLE_SOURCES := $(foreach TOOL,$(TOOLS),src/$(TOOL).c) | ||
# Modules are all object files exclusively for inclusion in libisri | ||
MODULE_SOURCES := $(filter-out $(EXECUTABLE_SOURCES),$(wildcard src/*.c)) | ||
MODULES := $(MODULE_SOURCES:.c=.o) | ||
# Dependencies are .d files included by Make | ||
DEPENDENCIES := $(EXECUTABLES:=.d) $(MODULES:.o=.d) | ||
|
||
-include $(DEPENDENCIES) | ||
|
||
# Rules for building executables; they are statically linked with the library. | ||
bin/%: src/%.c $(LIBRARY.a) | ||
$(LINK.c) -o $@ $< $(LDLIBS) | ||
|
||
$(LIBRARY.a): $(MODULES) | ||
$(AR) $(ARFLAGS) -s $@ $^ | ||
|
||
# Special case: Generate this include file, required by libisri.a | ||
$(TOP)src/word_break_property.h src/word_break_property.h: \ | ||
libexec/generate_word_break.py libexec/WordBreakProperty.txt.gz | ||
./$< > $@ |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Ensure that this directory exists in git | ||
# but ignore every file that it will be used for. | ||
*.a | ||
*.so | ||
*.so.* |
This file was deleted.