File: Makefile

package info (click to toggle)
btrfs-compsize 1.5-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 172 kB
  • sloc: ansic: 1,759; makefile: 31
file content (40 lines) | stat: -rw-r--r-- 729 bytes parent folder | download | duplicates (2)
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
PREFIX ?= /usr
CC ?= gcc
CFLAGS ?= -Wall -std=gnu90
SRC_DIR := $(dir $(lastword $(MAKEFILE_LIST)))


BIN := $(SRC_DIR)/compsize
C_FILES := $(wildcard $(SRC_DIR)/*.c)
OBJ_FILES := $(patsubst $(SRC_DIR)/%.c, $(SRC_DIR)/%.o, $(C_FILES))


all: $(BIN)

debug: CFLAGS += -Wall -DDEBUG -g
debug: $(BIN)


$(SRC_DIR)/%.o: $(SRC_DIR)/%.c
	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $^

$(BIN): $(OBJ_FILES)
	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^

BIN_I := $(DESTDIR)$(PREFIX)/bin/compsize

$(BIN_I): $(BIN)
	install -Dm755 $< $@

MAN_I := $(DESTDIR)$(PREFIX)/share/man/man8/compsize.8.gz

$(MAN_I): $(SRC_DIR)/compsize.8
	gzip -9n < $< > $@

install: $(BIN_I) $(MAN_I)

uninstall:
	@rm -vf $(BIN_I) $(MAN_I)

clean:
	@rm -vf $(BIN) $(OBJ_FILES)