1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 20:17:45 +00:00

Fix warning about time being deprecated

This commit is contained in:
Arcterus 2014-11-29 13:32:33 -08:00
parent 60fc8e9dcc
commit 1f89fd4b89
3 changed files with 31 additions and 22 deletions

3
.gitmodules vendored
View file

@ -1,3 +1,6 @@
[submodule "deps/rust-crypto"] [submodule "deps/rust-crypto"]
path = deps/rust-crypto path = deps/rust-crypto
url = git://github.com/DaGenix/rust-crypto.git url = git://github.com/DaGenix/rust-crypto.git
[submodule "deps/time"]
path = deps/time
url = https://github.com/rust-lang/time

View file

@ -6,8 +6,20 @@ ENABLE_STRIP ?= n
RUSTC ?= rustc RUSTC ?= rustc
RM := rm RM := rm
# Install directories
PREFIX ?= /usr/local
BINDIR ?= /bin
# This won't support any directory with spaces in its name, but you can just
# make a symlink without spaces that points to the directory.
BASEDIR ?= $(shell pwd)
SRCDIR := $(BASEDIR)/src
BUILDDIR := $(BASEDIR)/build
TESTDIR := $(BASEDIR)/test
TEMPDIR := $(BASEDIR)/tmp
# Flags # Flags
RUSTCFLAGS := --opt-level=3 RUSTCFLAGS := --opt-level=3 -L $(BUILDDIR)/
RMFLAGS := RMFLAGS :=
# Handle config setup # Handle config setup
@ -18,21 +30,9 @@ RUSTCBINFLAGS := $(RUSTCFLAGS)
endif endif
ifneq ($(ENABLE_STRIP),y) ifneq ($(ENABLE_STRIP),y)
ENABLE_STRIP := ENABLE_STRIP :=
endif endif
# Install directories
PREFIX ?= /usr/local
BINDIR ?= /bin
# This won't support any directory with spaces in its name, but you can just
# make a symlink without spaces that points to the directory.
BASEDIR ?= $(shell pwd)
SRCDIR := $(BASEDIR)/src
BUILDDIR := $(BASEDIR)/build
TESTDIR := $(BASEDIR)/test
TEMPDIR := $(BASEDIR)/tmp
# Possible programs # Possible programs
PROGS := \ PROGS := \
base64 \ base64 \
@ -168,7 +168,7 @@ $(BUILDDIR)/gen/$(1).rs: $(BUILDDIR)/mkmain
$(BUILDDIR)/mkmain $(1) $$@ $(BUILDDIR)/mkmain $(1) $$@
$(BUILDDIR)/$(1): $(BUILDDIR)/gen/$(1).rs $(BUILDDIR)/$($(1)_RLIB) | $(BUILDDIR) deps $(BUILDDIR)/$(1): $(BUILDDIR)/gen/$(1).rs $(BUILDDIR)/$($(1)_RLIB) | $(BUILDDIR) deps
$(RUSTC) $(RUSTCBINFLAGS) -L $(BUILDDIR)/ -o $$@ $$< $(RUSTC) $(RUSTCBINFLAGS) -o $$@ $$<
$(if $(ENABLE_STRIP),strip $$@,) $(if $(ENABLE_STRIP),strip $$@,)
endef endef
@ -176,7 +176,7 @@ define CRATE_BUILD
-include $(BUILDDIR)/$(1).d -include $(BUILDDIR)/$(1).d
$(BUILDDIR)/$($(1)_RLIB): $(SRCDIR)/$(1)/$(1).rs | $(BUILDDIR) deps $(BUILDDIR)/$($(1)_RLIB): $(SRCDIR)/$(1)/$(1).rs | $(BUILDDIR) deps
$(RUSTC) $(RUSTCFLAGS) -L $(BUILDDIR)/ --crate-type rlib --dep-info $(BUILDDIR)/$(1).d $$< --out-dir $(BUILDDIR) $(RUSTC) $(RUSTCFLAGS) --extern time=$(BUILDDIR)/libtime.rlib --crate-type rlib --dep-info $(BUILDDIR)/$(1).d $$< --out-dir $(BUILDDIR)
endef endef
# Aliases build rule # Aliases build rule
@ -198,7 +198,7 @@ test_$(1): $(TEMPDIR)/$(1)/$(1)_test $(BUILDDIR)/$(1)
$(call command,cp $(BUILDDIR)/$(1) $(TEMPDIR)/$(1) && cd $(TEMPDIR)/$(1) && $$<) $(call command,cp $(BUILDDIR)/$(1) $(TEMPDIR)/$(1) && cd $(TEMPDIR)/$(1) && $$<)
$(TEMPDIR)/$(1)/$(1)_test: $(TESTDIR)/$(1).rs | $(TEMPDIR)/$(1) $(TEMPDIR)/$(1)/$(1)_test: $(TESTDIR)/$(1).rs | $(TEMPDIR)/$(1)
$(call command,$(RUSTC) $(RUSTCFLAGS) --test -o $$@ $$<) $(call command,$(RUSTC) $(RUSTCFLAGS) --extern time=$(BUILDDIR)/libtime.rlib --test -o $$@ $$<)
$(TEMPDIR)/$(1): | $(TEMPDIR) $(TEMPDIR)/$(1): | $(TEMPDIR)
$(call command,cp -r $(TESTDIR)/fixtures/$(1) $$@ || mkdir $$@) $(call command,cp -r $(TESTDIR)/fixtures/$(1) $$@ || mkdir $$@)
@ -216,7 +216,7 @@ $(foreach test,$(TESTS),$(eval $(call TEST_BUILD,$(test))))
-include $(BUILDDIR)/uutils.d -include $(BUILDDIR)/uutils.d
$(BUILDDIR)/uutils: $(SRCDIR)/uutils/uutils.rs $(BUILDDIR)/mkuutils $(RLIB_PATHS) $(BUILDDIR)/uutils: $(SRCDIR)/uutils/uutils.rs $(BUILDDIR)/mkuutils $(RLIB_PATHS)
$(BUILDDIR)/mkuutils $(BUILDDIR)/gen/uutils.rs $(EXES) $(BUILDDIR)/mkuutils $(BUILDDIR)/gen/uutils.rs $(EXES)
$(RUSTC) $(RUSTCBINFLAGS) -L $(BUILDDIR)/ --dep-info $@.d $(BUILDDIR)/gen/uutils.rs -o $@ $(RUSTC) $(RUSTCBINFLAGS) --dep-info $@.d $(BUILDDIR)/gen/uutils.rs -o $@
$(if $(ENABLE_STRIP),strip $@) $(if $(ENABLE_STRIP),strip $@)
# Dependencies # Dependencies
@ -225,16 +225,21 @@ $(BUILDDIR)/.rust-crypto: | $(BUILDDIR)
$(RUSTC) $(RUSTCFLAGS) --crate-type rlib --dep-info $(BUILDDIR)/rust-crypto.d $(BASEDIR)/deps/rust-crypto/src/rust-crypto/lib.rs --out-dir $(BUILDDIR)/ $(RUSTC) $(RUSTCFLAGS) --crate-type rlib --dep-info $(BUILDDIR)/rust-crypto.d $(BASEDIR)/deps/rust-crypto/src/rust-crypto/lib.rs --out-dir $(BUILDDIR)/
@touch $@ @touch $@
$(BUILDDIR)/.rust-time:
cd $(BASEDIR)/deps/time && cargo build --release
cp -r $(BASEDIR)/deps/time/target/release/libtime*.rlib $(BUILDDIR)/libtime.rlib
@touch $@
$(BUILDDIR)/mkmain: mkmain.rs | $(BUILDDIR) $(BUILDDIR)/mkmain: mkmain.rs | $(BUILDDIR)
$(RUSTC) $(RUSTCFLAGS) -L $(BUILDDIR) $< -o $@ $(RUSTC) $(RUSTCFLAGS) $< -o $@
$(BUILDDIR)/mkuutils: mkuutils.rs | $(BUILDDIR) $(BUILDDIR)/mkuutils: mkuutils.rs | $(BUILDDIR)
$(RUSTC) $(RUSTCFLAGS) -L $(BUILDDIR) $< -o $@ $(RUSTC) $(RUSTCFLAGS) $< -o $@
$(SRCDIR)/cksum/crc_table.rs: $(SRCDIR)/cksum/gen_table.rs $(SRCDIR)/cksum/crc_table.rs: $(SRCDIR)/cksum/gen_table.rs
cd $(SRCDIR)/cksum && $(RUSTC) $(RUSTCFLAGS) gen_table.rs && ./gen_table && $(RM) gen_table cd $(SRCDIR)/cksum && $(RUSTC) $(RUSTCFLAGS) gen_table.rs && ./gen_table && $(RM) gen_table
deps: $(BUILDDIR)/.rust-crypto $(SRCDIR)/cksum/crc_table.rs deps: $(BUILDDIR)/.rust-crypto $(BUILDDIR)/.rust-time $(SRCDIR)/cksum/crc_table.rs
crates: crates:
echo $(EXES) echo $(EXES)
@ -243,7 +248,7 @@ test: $(TEMPDIR) $(addprefix test_,$(TESTS))
$(RM) -rf $(TEMPDIR) $(RM) -rf $(TEMPDIR)
clean: clean:
$(RM) -rf $(BUILDDIR) $(TEMPDIR) $(RM) -rf $(BUILDDIR) $(TEMPDIR) $(BASEDIR)/deps/time/target
$(BUILDDIR): $(BUILDDIR):
git submodule update --init git submodule update --init

1
deps/time vendored Submodule

@ -0,0 +1 @@
Subproject commit afab521f3b91658a3ba2d3e877b7e01699733bef