Import Upstream version 1.05+ds

This commit is contained in:
geos_one
2025-08-06 15:48:18 +02:00
parent 0ef82355c6
commit 7527bfa483
40 changed files with 1036 additions and 3526 deletions

View File

@@ -1,35 +1,8 @@
MAKEFLAGS += --silent
TARGET = hd-idle
PLATFORM := $(shell uname -m)
ARCH :=
ifeq ($(PLATFORM),x86_64)
ARCH = amd64
endif
ifeq ($(PLATFORM),aarch64)
ARCH = arm64
endif
ifeq ($(PLATFORM),armv7l)
ARCH = armhf
endif
GOARCH :=
ifeq ($(ARCH),amd64)
GOARCH = amd64
endif
ifeq ($(ARCH),i386)
GOARCH = 386
endif
ifeq ($(ARCH),arm64)
GOARCH = arm64
endif
ifeq ($(ARCH),armhf)
GOARCH = arm
endif
ifeq ($(GOARCH),)
$(error Invalid ARCH: $(ARCH))
endif
###############################################################################
#
# General Definitions
#
###############################################################################
ifdef DESTDIR
# dh_auto_install (Debian) sets this variable
@@ -38,22 +11,44 @@ else
TARGET_DIR ?= /usr/local
endif
LIB_DIRS =
INC_DIRS =
CC ?= gcc
CFLAGS += $(INC_DIRS) -Wall
LD = $(CC)
LDFLAGS += $(LIB_DIRS)
###############################################################################
#
# Main Dependencies
#
###############################################################################
TARGET = hd-idle
LIBS =
SRCS = hd-idle.c
OBJS = $(SRCS:.c=.o)
all: $(TARGET)
distclean: clean
clean:
rm -f $(TARGET)
rm -f $(OBJS) $(TARGET)
install: $(TARGET)
install -Dm755 $(TARGET) $(TARGET_DIR)/sbin/$(TARGET)
install -Dm755 debian/$(TARGET).8 $(TARGET_DIR)/share/man/man8/$(TARGET).8
install -D -g root -o root $(TARGET) $(TARGET_DIR)/sbin/$(TARGET)
install -D -g root -o root $(TARGET).1 $(TARGET_DIR)/share/man/man1/$(TARGET).1
uninstall:
rm -f $(TARGET_DIR)/sbin/$(TARGET)
hd-idle.o: hd-idle.c
$(TARGET): $(OBJS)
$(LD) $(LDFLAGS) -o $(TARGET) $(OBJS) $(LIB_DIRS) $(LIBS)
$(TARGET):
GOOS=linux GOARCH=$(GOARCH) go build
test:
go test ./... -race -cover