Fix build rules

This commit is contained in:
Glenn Y. Rolland 2022-08-16 21:35:19 +02:00
parent 3c6c9f0681
commit fda36c7d5a
3 changed files with 8 additions and 6 deletions

1
.gitignore vendored
View file

@ -1,4 +1,5 @@
/docs/ /docs/
_build
/lib/ /lib/
/bin/ /bin/
/.shards/ /.shards/

View file

@ -4,24 +4,24 @@ SOURCES=$(shell find -name '*.cr')
LDFLAGS= LDFLAGS=
DESTDIR=/usr DESTDIR=/usr
BUILDDIR=_build BUILD_DIR=_build
all: build all: build
$(BUILD_DIR): $(BUILD_DIR):
mkdir -p $(BUILD_DIR) mkdir -p $(BUILD_DIR)
$(BUILDDIR)/kathmandu_time: $(BUILDDIR) $(SOURCES) $(BUILD_DIR)/kathmandu_time: $(BUILD_DIR) $(SOURCES)
crystal build $(LDFLAGS) src/kathmandu_time.cr -o $(BUILDDIR)/kathmandu_time crystal build $(LDFLAGS) src/kathmandu_time.cr -o $(BUILD_DIR)/kathmandu_time
build: $(BUILDDIR)/kathmandu_time build: $(BUILD_DIR)/kathmandu_time
build-release: LDFLAGS=--release --no-debug build-release: LDFLAGS=--release --no-debug
build-release: build build-release: build
install: build install: build
install -m 0755 -o root -g root \ install -m 0755 -o root -g root \
$(BUILDDIR)/kathmandu_time \ $(BUILD_DIR)/kathmandu_time \
$(DESTDIR)/bin/kathmandu_time $(DESTDIR)/bin/kathmandu_time
spec: spec:
@ -33,5 +33,5 @@ run:
crystal run src/kathmandu_time.cr crystal run src/kathmandu_time.cr
clean: clean:
rm -f $(BUILDDIR)/kathmandu_time rm -f $(BUILD_DIR)/kathmandu_time

View file

@ -8,6 +8,7 @@ TODO: Write installation instructions here
## Usage ## Usage
TODO: Write usage instructions here TODO: Write usage instructions here
## Development ## Development