makefiles: Build programs that link against libwine twice with appropriate rpaths.
[wine] / tools / Makefile.in
1 TOPSRCDIR = @top_srcdir@
2 TOPOBJDIR = ..
3 SRCDIR    = @srcdir@
4 VPATH     = @srcdir@
5 EXEEXT    = @EXEEXT@
6 MODULE    = none
7 EXTRAINCL = @FREETYPEINCL@
8 FREETYPELIBS = @FREETYPELIBS@
9
10 PROGRAMS = \
11         bin2res$(EXEEXT) \
12         fnt2bdf$(EXEEXT) \
13         fnt2fon$(EXEEXT) \
14         make_ctests$(EXEEXT) \
15         makedep$(EXEEXT) \
16         relpath$(EXEEXT) \
17         sfnt2fnt$(EXEEXT) \
18         wineprefixcreate
19
20 MANPAGES = \
21         winemaker.man \
22         wineprefixcreate.man
23
24 C_SRCS = \
25         bin2res.c \
26         fnt2bdf.c \
27         fnt2fon.c \
28         make_ctests.c \
29         makedep.c \
30         relpath.c \
31         sfnt2fnt.c \
32
33 INSTALLSUBDIRS = \
34         widl \
35         winebuild \
36         winedump \
37         winegcc \
38         wmc \
39         wrc
40
41 SUBDIRS = $(INSTALLSUBDIRS)
42
43 EXTRASUBDIRS = winapi
44
45 INSTALLDIRS = \
46         $(DESTDIR)$(bindir) \
47         $(DESTDIR)$(datadir)/applications \
48         $(DESTDIR)$(datadir)/wine \
49         $(DESTDIR)$(mandir)/man$(prog_manext)
50
51 UPDATE_DESKTOP_DATABASE = update-desktop-database
52
53 all: $(PROGRAMS) $(MANPAGES) $(SUBDIRS)
54
55 @MAKE_RULES@
56
57 makedep$(EXEEXT) $(EXEEXT:%=makedep): makedep.o
58         $(CC) $(CFLAGS) -o $@ makedep.o $(LDFLAGS)
59
60 make_ctests$(EXEEXT): make_ctests.o
61         $(CC) $(CFLAGS) -o $@ make_ctests.o $(LDFLAGS)
62
63 fnt2bdf$(EXEEXT): fnt2bdf.o
64         $(CC) $(CFLAGS) -o $@ fnt2bdf.o $(LIBPORT) $(LDFLAGS)
65
66 fnt2fon$(EXEEXT): fnt2fon.o
67         $(CC) $(CFLAGS) -o $@ fnt2fon.o $(LIBPORT) $(LDFLAGS)
68
69 relpath$(EXEEXT): relpath.o
70         $(CC) $(CFLAGS) -o $@ relpath.o $(LIBPORT) $(LDFLAGS)
71
72 sfnt2fnt$(EXEEXT): sfnt2fnt.o relpath$(EXEEXT)
73         $(CC) $(CFLAGS) -o $@ sfnt2fnt.o $(LIBWINE) $(LIBPORT) $(LDFLAGS) $(FREETYPELIBS) $(LDRPATH_LOCAL)
74
75 bin2res$(EXEEXT): bin2res.o
76         $(CC) $(CFLAGS) -o $@ bin2res.o $(LIBPORT) $(LDFLAGS)
77
78 wineprefixcreate: wineprefixcreate.in relpath$(EXEEXT)
79         sed -e "s,@bintodlldir\@,`$(RELPATH) $(bindir) $(dlldir)`,g" -e "s,@bintodatadir\@,`$(RELPATH) $(bindir) $(datadir)/wine`,g" $(SRCDIR)/wineprefixcreate.in >$@ || ($(RM) $@ && false)
80         chmod +x wineprefixcreate
81
82 install install-lib:: wineprefixcreate $(INSTALLDIRS)
83         $(INSTALL_SCRIPT) wineprefixcreate $(DESTDIR)$(bindir)/wineprefixcreate
84         $(INSTALL_DATA) $(SRCDIR)/wine.inf $(DESTDIR)$(datadir)/wine/wine.inf
85         $(INSTALL_DATA) $(SRCDIR)/wine.desktop $(DESTDIR)$(datadir)/applications/wine.desktop
86         $(INSTALL_DATA) wineprefixcreate.man $(DESTDIR)$(mandir)/man$(prog_manext)/wineprefixcreate.$(prog_manext)
87         -$(UPDATE_DESKTOP_DATABASE)
88
89 install install-dev:: $(INSTALLSUBDIRS:%=%/__install__) $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man$(prog_manext)
90         $(INSTALL_SCRIPT) $(SRCDIR)/winemaker $(DESTDIR)$(bindir)/winemaker
91         $(INSTALL_DATA) winemaker.man $(DESTDIR)$(mandir)/man$(prog_manext)/winemaker.$(prog_manext)
92
93 uninstall::
94         $(RM) $(DESTDIR)$(bindir)/winemaker $(DESTDIR)$(bindir)/wineprefixcreate $(DESTDIR)$(mandir)/man$(prog_manext)/winemaker.$(prog_manext) $(DESTDIR)$(mandir)/man$(prog_manext)/wineprefixcreate.$(prog_manext) $(DESTDIR)$(datadir)/wine/wine.inf $(DESTDIR)$(datadir)/applications/wine.desktop
95         -$(UPDATE_DESKTOP_DATABASE)
96
97 wmc wrc: relpath$(EXEEXT)
98
99 @DEPENDENCIES@  # everything below this line is overwritten by make depend
100
101 Makefile: makedep$(EXEEXT)