libtest/Makefile
author Markus Bröker <mbroeker@largo.dyndns.tv>
Thu, 16 Apr 2009 12:49:11 +0200
changeset 36 f52a9deddfc0
parent 7 a1aa30f0f904
child 66 2b4f786d9073
permissions -rw-r--r--
cube.cc: * Create an object, move this object. * don't try to re-create an object of a fixed size... committer: Markus Bröker <mbroeker@largo.homelinux.org>

     CC = gcc
 CFLAGS =-Wall -O2 -fPIC
LDFLAGS = -Llib -ltest
OBJECTS = func1.o func2.o

.c.o:
	$(CC) -c $(CFLAGS) -shared $<

all: lib/libtest.so.1.0.1 prog

prog: main.c
	$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@

lib/libtest.so.1.0.1: $(OBJECTS)
	$(CC) -shared -Wl,-soname,lib/libtest.so.1 $(OBJECTS) -o $@
	@echo "Look carefully at this :)"
	ln -s libtest.so.1.0.1 lib/libtest.so.1
	ln -s libtest.so.1.0.1 lib/libtest.so

.PHONY: clean

clean:
	rm -f lib/libtest.*
	rm -f *.o prog