initial import for sdlhaa & sdlhim
[sdlhildon] / sdlhaa / src / Makefile
1 PREFIX:=$(shell sdl-config --prefix)
2 CFLAGS:=-g -O0 -Wall -Wextra
3
4 CC:=gcc
5
6 RELEASE:=1.2
7 VERSION:=0:1:0
8
9 SDL_HAA_TARGET:=libSDL_haa.la
10
11 SDL_HAA_LDLIBS:=$(shell sdl-config --libs) $(shell pkg-config --libs x11 xext)
12 SDL_HAA_CFLAGS:=-DHAVE_XSHM \
13         $(shell sdl-config --cflags) $(shell pkg-config --cflags x11 xext)
14 SDL_HAA_LDFLAGS:=-release $(RELEASE) -version-info $(VERSION) -rpath $(PREFIX)/lib
15
16 all: $(SDL_HAA_TARGET)
17
18 $(SDL_HAA_TARGET): SDL_haa.lo
19         $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) $(SDL_HAA_LDFLAGS) $(LDLIBS) $(SDL_HAA_LDLIBS) -o $@ $^
20         
21 SDL_haa.lo: SDL_haa.c
22         $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(SDL_HAA_CFLAGS) -c $^
23         
24 clean:
25         $(LIBTOOL) --mode=clean rm -f *.o *.lo $(SDL_HAA_TARGET)
26         
27 install: $(SDL_HAA_TARGET)
28         install -d $(DESTDIR)$(PREFIX)/include/SDL $(DESTDIR)$(PREFIX)/lib
29         install SDL_haa.h $(DESTDIR)$(PREFIX)/include/SDL/
30         $(LIBTOOL) --mode=install install -c $(SDL_HAA_TARGET) $(DESTDIR)$(PREFIX)/lib/
31 ifeq ($(DESTDIR),)
32         $(LIBTOOL) --mode=finish $(PREFIX)/lib
33 endif
34
35 uninstall:
36         -$(LIBTOOL) --mode=uninstall rm $(DESTDIR)$(PREFIX)/lib/$(SDL_HAA_TARGET)
37         -rm $(DESTDIR)$(PREFIX)/include/SDL/SDL_haa.h
38