Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cargoify rust-png #43

Merged
merged 1 commit into from Aug 26, 2014
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -8,3 +8,5 @@
/Makefile
/test_store.png
/doc
/target
/Cargo.lock
@@ -0,0 +1,11 @@
[package]

name = "png"
version = "0.1.0"
authors = ["The Servo Project Developers"]

build = "make -f makefile.cargo"

[dependencies.png-sys]

git = "https://github.com/servo/libpng"
@@ -14,14 +14,14 @@ RUSTDOC_TARGET ?= doc
.PHONY: all
all: libpng-servo.dummy

%.o: %.c
shim.o: src/shim.c
$(CC) $< -o $@ -c $(CFLAGS)

libpng-servo.dummy: lib.rs libshim.a $(EXT_DEPS)
libpng-servo.dummy: src/lib.rs libshim.a $(EXT_DEPS)
$(RUSTC) $(RUSTFLAGS) $< --out-dir . -C extra-filename=-servo
touch $@

png-test: lib.rs libshim.a
png-test: src/lib.rs libshim.a
$(RUSTC) $(RUSTFLAGS) $< -o $@ --test

libshim.a: shim.o
@@ -30,7 +30,7 @@ libshim.a: shim.o
.PHONY: doc
doc: $(RUSTDOC_TARGET)/png/index.html

$(RUSTDOC_TARGET)/png/index.html: lib.rs $(RUST_SRC) $(EXT_DEPS)
$(RUSTDOC_TARGET)/png/index.html: src/lib.rs $(RUST_SRC) $(EXT_DEPS)
$(RUSTDOC) $(RUSTDOC_FLAGS) $< -o $(RUSTDOC_TARGET)

check: png-test
@@ -0,0 +1,16 @@
CC ?= gcc
CXX ?= g++
AR ?= ar

PNG_OUTDIR = $(shell find $(OUT_DIR)/.. -name 'png-sys-*' -type d)

CFLAGS += -fPIC -I$(PNG_OUTDIR)

.PHONY: all
all: $(OUT_DIR)/libshim.a

$(OUT_DIR)/shim.o: src/shim.c
$(CC) $< -o $@ -c $(CFLAGS)

$(OUT_DIR)/libshim.a: $(OUT_DIR)/shim.o
$(AR) rcs $@ $(OUT_DIR)/shim.o
File renamed without changes.
File renamed without changes.
File renamed without changes.
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.