aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile26
1 files changed, 26 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..f69be8d
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,26 @@
+CC = gcc
+CFLAGS = -O2 -Wall -W
+CFLAGS += `pkg-config --cflags libdrm`
+LDFLAGS = `pkg-config --libs libdrm`
+PROGRAM = drm_master_util
+INSTALL = /usr/bin/install
+PREFIX = /usr
+
+all: $(PROGRAM)
+
+$(PROGRAM): drm_master_util.o
+ $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
+
+install: $(PROGRAM)
+ $(INSTALL) $(PROGRAM) $(PREFIX)/bin
+ chmod u+s $(PREFIX)/bin/${PROGRAM}
+
+clean:
+ rm -f *.o $(PROGRAM)
+
+distclean: clean
+
+%.o: %.c
+ $(CC) $(CFLAGS) -c $^ -I. -o $@
+
+.PHONY: all install clean distclean