Makefile 661 Bytes
Newer Older
1
LIBRARIES=libmoberg_serial2002.so
Anders Blomdell's avatar
Anders Blomdell committed
2
CCFLAGS+=-Wall -Werror -I../.. -I. -O3 -g -fPIC
3
LDFLAGS+=-Lbuild/ -lmoberg
Anders Blomdell's avatar
Anders Blomdell committed
4
LDFLAGS_serial2002=-shared -fPIC -L../../build -lmoberg  
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
build/serial2002.o: ../../moberg_module.h
build/serial2002.o: serial2002_lib.h
23
build/serial2002_lib.o: serial2002_lib.h
Anders Blomdell's avatar
Anders Blomdell committed
24
25
build/libmoberg_serial2002.so: build/serial2002.o
build/libmoberg_serial2002.so: build/serial2002_lib.o