Skip to content

Commit 6fa3830

Browse files
committed
Merge README and Makefile from recode-c.
2 parents 3b0a568 + caffb2f commit 6fa3830

2 files changed

Lines changed: 43 additions & 0 deletions

File tree

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ LDFLAGS = -Wl,--gc-sections -ldl -lpthread -lgcc_s -lrt -lc -lm -lstdc++
1313
recode_cpp: recode_cpp.o ../encoding-rs/target/release/libencoding_rs.a
1414
$(CC) -o $@ $^ $(LDFLAGS)
1515

16+
recode_c.o: recode_c.c ../encoding-rs/target/include/encoding_rs.h
17+
1618
../encoding-rs/target/release/libencoding_rs.a: cargo
1719

1820
../encoding-rs/target/include/encoding_rs.h: cargo

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,44 @@ It expects encoding-rs and [GSL](https://github.com/Microsoft/GSL) to have been
99

1010
Please see the file named COPYRIGHT.
1111

12+
## Building
13+
14+
Git, GNU Make and a version of GCC recent enough to accept `-std=c11` are
15+
assumed to be already installed.
16+
17+
###0. Install Rust (including Cargo) if you haven't already
18+
19+
See the [Rust download page](https://www.rust-lang.org/downloads.html). For
20+
Linux and OS X, this means:
21+
```
22+
curl -sSf https://static.rust-lang.org/rustup.sh | sh
23+
```
24+
25+
###1. Clone encoding-rs
26+
27+
```
28+
git clone https://github.com/hsivonen/encoding-rs.git
29+
```
30+
31+
###2. Enable staticlib support for encoding-rs
32+
33+
Edit `encoding-rs/Cargo.toml` and uncomment the line
34+
```
35+
# crate-type = ["rlib", "staticlib"]
36+
```
37+
38+
(The line is commented out due to a
39+
[rustfmt bug](https://github.com/rust-lang-nursery/rustfmt/issues/828).)
40+
41+
###3. Clone recode-c
42+
43+
```
44+
git clone https://github.com/hsivonen/recode-c.git
45+
```
46+
47+
###4. Build recode-c
48+
49+
```
50+
cd recode-c
51+
make
52+
```

0 commit comments

Comments
 (0)