Skip to content

Commit

Permalink
Make Makefile more portable
Browse files Browse the repository at this point in the history
- Use -d instead of -D
- Add all target
- Mark install target as phony
  • Loading branch information
phy1729 committed Jan 19, 2015
1 parent c01ef4f commit 59db9c6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Makefile
Expand Up @@ -9,14 +9,18 @@ CFLAGS += `pkg-config --cflags xtst x11`
LDFLAGS += `pkg-config --libs xtst x11`
LDFLAGS += -pthread

all: $(TARGET)

$(TARGET): xcape.c
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)

install:
$(INSTALL) -Dm 755 $(TARGET) $(DESTDIR)$(PREFIX)/bin/$(TARGET)
$(INSTALL) -Dm 644 xcape.1 $(DESTDIR)$(PREFIX)$(MANDIR)/xcape.1
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)$(MANDIR)
$(INSTALL) -m 0755 $(TARGET) $(DESTDIR)$(PREFIX)/bin/$(TARGET)
$(INSTALL) -m 0644 xcape.1 $(DESTDIR)$(PREFIX)$(MANDIR)/xcape.1

clean:
rm $(TARGET)

.PHONY: clean
.PHONY: all clean install

0 comments on commit 59db9c6

Please sign in to comment.