adopt to winsock
[melted] / src / melted / Makefile
1 include ../../config.mak
2
3 TARGET = melted
4
5 ifneq ($(targetos), Darwin)
6 LIBNAME = libmelted$(LIBSUF)
7 LIBTARGET = $(LIBNAME).$(version)
8 LIBSONAME = $(LIBNAME).$(soversion)
9 SHFLAGS += -Wl,-soname,$(LIBSONAME)
10 else
11 LIBNAME = libmelted$(LIBSUF)
12 LIBTARGET = libmelted.$(version)$(LIBSUF)
13 LIBSONAME = libmelted.$(soversion)$(LIBSUF)
14 SHFLAGS += -install_name $(libdir)/$(LIBSONAME) -current_version $(version) -compatibility_version $(soversion)
15 endif
16
17 APP_OBJS = melted.o
18
19 LIB_OBJS = melted_log.o \
20 melted_server.o \
21 melted_connection.o \
22 melted_local.o \
23 melted_unit.o \
24 melted_commands.o \
25 melted_unit_commands.o
26
27 INCS = melted_server.h \
28 melted_local.h \
29 melted_log.h
30
31 OBJS = $(APP_OBJS) $(LIB_OBJS)
32
33 CFLAGS += -I.. $(RDYNAMIC) -DVERSION=\"$(version)\"
34
35 LDFLAGS += -L../mvcp -lmvcp
36 LDFLAGS += -lpthread
37
38 SRCS := $(OBJS:.o=.c)
39
40 all: $(TARGET)
41
42 $(TARGET): $(APP_OBJS) $(LIBTARGET)
43 $(CC) -o $@ $(APP_OBJS) -L. -lmelted $(LDFLAGS)
44
45 $(LIBTARGET): $(LIB_OBJS)
46 $(CC) $(SHFLAGS) -o $@ $(LIB_OBJS) $(LDFLAGS)
47 ln -sf $(LIBTARGET) $(LIBNAME)
48 ln -sf $(LIBTARGET) $(LIBSONAME)
49
50 depend: $(SRCS)
51 $(CC) -MM $(CFLAGS) $^ 1>.depend
52
53 distclean: clean
54 rm -f .depend
55
56 clean:
57 rm -f $(OBJS) $(TARGET) $(LIBNAME) $(LIBTARGET) $(LIBSONAME)
58
59 install: all
60 install -d "$(DESTDIR)$(bindir)"
61 install -c -s -m 755 $(TARGET) "$(DESTDIR)$(bindir)"
62 install -m 755 $(LIBTARGET) $(DESTDIR)$(libdir)
63 ln -sf $(LIBTARGET) $(DESTDIR)$(libdir)/$(LIBSONAME)
64 ln -sf $(LIBTARGET) $(DESTDIR)$(libdir)/$(LIBNAME)
65 mkdir -p "$(DESTDIR)$(prefix)/include/mlt/melted"
66 install -m 644 $(INCS) "$(DESTDIR)$(prefix)/include/mlt/melted"
67
68 uninstall:
69 rm -f "$(DESTDIR)$(bindir)/$(TARGET)"
70 rm -f "$(DESTDIR)$(libdir)/$(LIBTARGET)"
71 rm -f "$(DESTDIR)$(libdir)/$(LIBSONAME)"
72 rm -f "$(DESTDIR)$(libdir)/$(LIBNAME)"
73 rm -rf "$(DESTDIR)$(prefix)/include/mlt/melted"
74
75 ifneq ($(wildcard .depend),)
76 include .depend
77 endif