Skip to content

Commit bcb1b30

Browse files
committed
make install
1 parent 3ea15b2 commit bcb1b30

1 file changed

Lines changed: 13 additions & 10 deletions

File tree

Makefile

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,31 @@
11
images_names=kodim01.png kodim02.png
22

3-
all: split
4-
images:$(addprefix testImage/,$(images_names))
5-
.PHONY: clean test
6-
7-
BINS=split tests/createBlankImage
3+
PREFIX ?= /usr/local
4+
PROG=split
5+
BINS=${PROG} tests/createBlankImage
86
OBJ:=split.o lib/fillwithblack.o lib/manppm.o
97
EXTRACFLAGS=
108
CFLAGS=-Wall $(EXTRACFLAGS)
119

10+
all: ${PROG}
11+
images:$(addprefix testImage/,$(images_names))
12+
.PHONY: clean test
13+
1214
$(BINS):
1315
$(CC) $(CFLAGS) -lm -o $@ $^
1416

15-
split: $(OBJ)
17+
${PROG}: $(OBJ)
1618
tests/createBlankImage: tests/createBlankImage.o lib/fillwithblack.o lib/manppm.o
1719

1820

1921
testImage/kodim%.png:
2022
wget --quiet http://r0k.us/graphics/kodak/kodak/$(notdir $@) -O $@
2123

2224
clean:
23-
rm -f $(OBJ) split tests/createBlankImage
24-
25+
rm -f $(OBJ) ${PROG} tests/createBlankImage
2526

26-
27-
test: tests/cuttest tests/createBlankImage split
27+
test: tests/cuttest tests/createBlankImage ${PROG}
2828
cd $(dir $<) && bash $(notdir $<)
29+
30+
install:
31+
@install -Dm755 ${PROG} ${DESTDIR}/${PREFIX}/bin/${PROG}

0 commit comments

Comments
 (0)