summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2008-11-03 00:49:34 +0100
committerHenrik Rydberg <rydberg@euromail.se>2008-11-03 00:49:34 +0100
commit70ba2dbf0f49a4f8d1caa2bbed97c8c2358c6fb6 (patch)
treee1697049bc32fd47b1e639969b4ff752689c92a8 /Makefile
Initial version: adding some files
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile57
1 files changed, 57 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..c387266
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,57 @@
+LIBRARY = multitouch.so
+FDIS = 11-multitouch.fdi
+MODULES = src
+
+o_src = multitouch
+
+TARGETS = $(addsuffix /test,$(MODULES))
+
+OBJECTS = $(addsuffix .o,\
+ $(foreach mod,$(MODULES),\
+ $(addprefix $(mod)/,$(o_$(mod)))))
+
+TBIN = $(addprefix bin/,$(TARGETS))
+TLIB = $(addprefix obj/,$(LIBRARY))
+TOBJ = $(addprefix obj/,$(addsuffix .o,$(TARGETS)))
+TFDI = $(addprefix fdi/,$(FDIS))
+OBJS = $(addprefix obj/,$(OBJECTS))
+LIBS = #-lhal -ldbus-glib-1
+
+DLIB = usr/lib/xorg/modules/input
+DFDI = usr/share/hal/fdi/policy/20thirdparty
+
+INCLUDE = -I.
+OPTS = -O3
+
+.PHONY: all clean
+.PRECIOUS: obj/%.o
+
+all: $(OBJS) $(TLIB) $(TOBJ) $(TBIN)
+
+bin/%: obj/%.o
+ @mkdir -p $(@D)
+ gcc $(INCLUDE) $(OPTS) $< $(TLIB) $(LIBS) -o $@
+
+$(TLIB): $(OBJS)
+ @rm -f $(TLIB)
+ gcc -shared $(OBJS) -Wl,-soname -Wl,$(LIBRARY) -o $@
+
+obj/%.o: %.c
+ @mkdir -p $(@D)
+ gcc -c $< -o $@
+
+obj/%.o: %.cc
+ @mkdir -p $(@D)
+ gcc -c $< -o $@
+
+clean:
+ rm -rf bin obj
+
+distclean: clean
+ rm -rf debian/*.log debian/files
+
+install: $(TLIB) $(TFDI)
+ install -d "$(DESTDIR)/$(DLIB)"
+ install -d "$(DESTDIR)/$(DFDI)"
+ install -m 755 $(TBIN) "$(DESTDIR)/$(DLIB)"
+ install -m 644 $(TFDI) "$(DESTDIR)/$(DFDI)"