-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (37 loc) · 1.04 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
###############################################################################
#
# General Definitions
#
###############################################################################
ifdef DESTDIR
# dh_auto_install (Debian) sets this variable
TARGET_DIR = $(DESTDIR)/usr
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 $(OBJS) $(TARGET)
install: $(TARGET)
install -D $(TARGET) $(TARGET_DIR)/sbin/$(TARGET)
install -d $(TARGET_DIR)/share/man/man1/
install -p -m 644 $(TARGET).1 $(TARGET_DIR)/share/man/man1/$(TARGET).1
hd-idle.o: hd-idle.c
$(TARGET): $(OBJS)
$(LD) $(LDFLAGS) -o $(TARGET) $(OBJS) $(LIB_DIRS) $(LIBS)