diff options
author | Sebastian Reichel <sre@ring0.de> | 2012-02-26 19:25:42 +0100 |
---|---|---|
committer | Sebastian Reichel <sre@ring0.de> | 2012-02-26 19:25:42 +0100 |
commit | 2e82359fa5bf7c34e9cbb3436fe9da0289710399 (patch) | |
tree | c6b017359328258116d370273d7c18cc15eb81d3 /Makefile | |
download | weatherstation-2e82359fa5bf7c34e9cbb3436fe9da0289710399.tar.bz2 |
initial code import
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 31 |
1 files changed, 31 insertions, 0 deletions
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 |