Makefile 663 Bytes
Newer Older
1
LIBRARIES=libmoberg_comedi.so
Anders Blomdell's avatar
Anders Blomdell committed
2
3
CCFLAGS+=-Wall -Werror -I../.. -I. -O3 -g -fPIC
LDFLAGS+=-Lbuild/ -lmoberg
4
LDFLAGS_comedi=-shared -fPIC -L../../build -lmoberg -lcomedi -lm  
5

Anders Blomdell's avatar
Anders Blomdell committed
6
all:	$(LIBRARIES:%=build/%)
7

Anders Blomdell's avatar
Anders Blomdell committed
8
9
build/libmoberg_%.so: build/%.o Makefile | build
	$(CC) $(LDFLAGS) $(LDFLAGS_$(*)) -o $@ $(filter %.o,$^)
10

Anders Blomdell's avatar
Anders Blomdell committed
11
12
13
14
15
16
17
.PRECIOUS: build/%.o
build/%.o:      %.c Makefile | build
	$(CC) $(CCFLAGS) -c -o $@ $<

build:
	mkdir -p $@

Anders Blomdell's avatar
Anders Blomdell committed
18
19
20
clean:
	rm -f build/*

Anders Blomdell's avatar
Anders Blomdell committed
21
22
23
24
25
26
build/comedi.c: ../../moberg.h
build/comedi.o: ../../moberg_config.h
build/comedi.o: ../../moberg_device.h
build/comedi.o: ../../moberg_inline.h
build/comedi.o: ../../moberg_module.h
build/comedi.o: ../../moberg_parser.h