Skip to content

Commit

Permalink
make install
Browse files Browse the repository at this point in the history
  • Loading branch information
boyska committed Jan 30, 2015
1 parent 3e0ec0c commit c94d004
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
images_names=kodim01.png kodim02.png

all: split
images:$(addprefix testImage/,$(images_names))
.PHONY: clean test

BINS=split tests/createBlankImage
PREFIX ?= /usr/local
PROG=split
BINS=${PROG} tests/createBlankImage
OBJ:=split.o lib/fillwithblack.o lib/manppm.o
EXTRACFLAGS=
CFLAGS=-Wall $(EXTRACFLAGS)

all: ${PROG}
images:$(addprefix testImage/,$(images_names))
.PHONY: clean test

$(BINS):
$(CC) $(CFLAGS) -lm -o $@ $^

split: $(OBJ)
${PROG}: $(OBJ)
tests/createBlankImage: tests/createBlankImage.o lib/fillwithblack.o lib/manppm.o


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

clean:
rm -f $(OBJ) split tests/createBlankImage

rm -f $(OBJ) ${PROG} tests/createBlankImage


test: tests/cuttest tests/createBlankImage split
test: tests/cuttest tests/createBlankImage ${PROG}
cd $(dir $<) && bash $(notdir $<)

install:
@install -Dm755 ${PROG} ${DESTDIR}/${PREFIX}/bin/${PROG}

0 comments on commit c94d004

Please sign in to comment.