From 2e82359fa5bf7c34e9cbb3436fe9da0289710399 Mon Sep 17 00:00:00 2001 From: Sebastian Reichel Date: Sun, 26 Feb 2012 19:25:42 +0100 Subject: initial code import --- Makefile | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..aee11ca --- /dev/null +++ b/Makefile @@ -0,0 +1,31 @@ +VALAC?=valac +SOURCES:=$(wildcard *.c) +OBJECTS:=$(patsubst %.c, %.o, $(SOURCES)) +CFLAGS+=`pkg-config --cflags libusb` +LIBS+=`pkg-config --libs libusb` +NAME:=libweatherstation.so +SONAME=$(NAME).0 +LONGNAME=$(NAME).0.0 + +all: library demo + +library: $(LONGNAME) + @ln -sf $(LONGNAME) $(SONAME) + @ln -sf $(SONAME) $(NAME) + +%.o: %.c + @echo "[CC] $<" + @$(CC) $(CFLAGS) -c -std=c99 -fPIC -o $@ $< + +$(LONGNAME): $(OBJECTS) + @echo "[LD] $^" + @$(CC) -shared -Wl,-soname,$(SONAME) -o $@ $(LIBS) $^ + +demo: demo.vala + @echo "[VALAC] $^" + @$(VALAC) --vapidir=. --Xcc=-I. --Xcc=-L. --Xcc=-lweatherstation --pkg posix --pkg libweatherstation $^ + +clean: + rm -f $(OBJECTS) $(LONGNAME) $(SONAME) $(NAME) demo + +.PHONY: all library clean -- cgit v1.2.3