2005-05-08 Alp Toker <alp@atoker.com>
[mono.git] / mcs / tools / cilc / res-Makefile
1 include defs.mk
2
3 LIBNAME = $(shell echo $(basename $(SONAME)) | sed -e 's/^lib//')
4 HTARGET = $(prefix)/include/$(LIBNAME)/
5 LIBTARGET = $(prefix)/lib/
6
7 CFLAGS += -static -fpic $(shell pkg-config --cflags glib-2.0 gobject-2.0 mono) $(EXTRAINCLUDES) -I.
8
9 ifdef bundle
10 EXTRAOBJS = bundle.o
11 CFLAGS += -DCILC_BUNDLE
12 EXTRATARGETS = bundle.h
13 endif
14
15 ifndef prefix
16 prefix = $(CWD)
17 endif
18
19 all: $(SONAME)
20
21 $(SONAME): $(EXTRAOBJS) $(OBJS)
22         gcc -Wall -fpic -shared `pkg-config --libs glib-2.0 gobject-2.0 mono` -lpthread $(EXTRAOBJS) $(OBJS) $(EXTRALIBS) -o $(SONAME)
23
24 $(LIBNAME).o: $(EXTRATARGETS)
25
26 bundle.o bundle.h: $(ASSEMBLY)
27         mkbundle -c -o bundle.c.tmp -oo bundle.o $(ASSEMBLY)
28         rm -f xx*
29         csplit bundle.c.tmp /mono_main/
30         mv xx00 bundle.h
31         rm -f xx*
32         rm -f bundle.c.tmp
33
34 install_libs: $(SONAME)
35         mkdir -p $(LIBTARGET)
36         install -s $(SONAME) $(LIBTARGET)
37
38 install_headers: *.h
39         mkdir -p $(HTARGET)
40         install *.h $(HTARGET)
41
42 install: install_libs install_headers
43
44 clean:
45         rm -rf core *~ *.o *.so bundle.h
46