aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile16
1 files changed, 12 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index e1e4beb..29527c9 100644
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,17 @@
-# User configuration
--include config.mk
-
SRCFILES := $(wildcard src/*.c)
OBJFILES := $(SRCFILES:%.c=%.o)
DEPFILES := $(OBJFILES:%.o=%.d)
CLEANFILES := $(CLEANFILES) $(DEPFILES) $(OBJFILES) meh
-LIBS := -lX11 -lXext -ljpeg -lpng -lgif
+LIBS ?= -lX11 -lXext -ljpeg -lpng -lgif
+PREFIX ?= /usr/local
+BINDIR = $(PREFIX)/bin
+
+# User configuration
+-include config.mk
+
+
+
meh: $(OBJFILES)
$(CC) $(LDFLAGS) -o $@ $(OBJFILES) $(LIBS)
@@ -16,6 +21,9 @@ meh: $(OBJFILES)
%.o: %.c Makefile
$(CC) $(CFLAGS) -MMD -MP -MT "$*.d" -c -o $@ $<
+install:
+ install -m 755 meh $(BINDIR)
+
# Clean
clean:
$(RM) $(CLEANFILES)