kathmandu_time/Makefile

38 lines
595 B
Makefile
Raw Permalink Normal View History

2022-08-16 19:33:02 +00:00
SOURCES=$(shell find -name '*.cr')
LDFLAGS=
DESTDIR=/usr
2022-08-16 19:35:19 +00:00
BUILD_DIR=_build
2022-08-16 19:33:02 +00:00
all: build
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)
2022-08-16 19:35:19 +00:00
$(BUILD_DIR)/kathmandu_time: $(BUILD_DIR) $(SOURCES)
crystal build $(LDFLAGS) src/kathmandu_time.cr -o $(BUILD_DIR)/kathmandu_time
2022-08-16 19:33:02 +00:00
2022-08-16 19:35:19 +00:00
build: $(BUILD_DIR)/kathmandu_time
2022-08-16 19:33:02 +00:00
build-release: LDFLAGS=--release --no-debug
build-release: build
install: build
install -m 0755 -o root -g root \
2022-08-16 19:35:19 +00:00
$(BUILD_DIR)/kathmandu_time \
2022-08-16 19:33:02 +00:00
$(DESTDIR)/bin/kathmandu_time
spec:
crystal spec
test: spec
run:
crystal run src/kathmandu_time.cr
clean:
2022-08-16 19:35:19 +00:00
rm -f $(BUILD_DIR)/kathmandu_time
2022-08-16 19:33:02 +00:00