Makeprog.rules.in 1.53 KB
Newer Older
1 2 3 4
# Global rules for building a Winelib program     -*-Makefile-*-
#
# Each individual makefile should define the following variables:
# MODULE       : name of the main module being built
5
# APPMODE      : program mode (-mwindows,-mconsole)
6 7 8 9 10 11
# EXTRALIBS    : extra libraries to link in (optional)
# EXTRADEFS    : extra symbol definitions, like -DWINELIB (optional)
#
# plus all variables required by the global Make.rules.in
#

12
DLLFLAGS    = @DLLFLAGS@
13
DEFS        = -D__WINESRC__ $(EXTRADEFS)
14
ALL_LIBS    = $(DELAYIMPORTS:%=-l%) $(IMPORTS:%=-l%) $(EXTRALIBS) -lwine $(LIBPORT) $(LDFLAGS) $(LIBS)
15
INSTALLDIRS = $(DESTDIR)$(bindir) $(DESTDIR)$(dlldir) $(DESTDIR)$(fakedlldir) $(DESTDIR)$(mandir)/man$(prog_manext)
16 17 18

@MAKE_RULES@

19
all: $(MODULE)$(DLLEXT) $(MODULE)$(FAKEEXT)
20

21
$(MODULE) $(MODULE).so $(MODULE).fake: $(OBJS) Makefile.in
22
	$(WINEGCC) $(APPMODE) $(OBJS) -o $@ $(ALL_LIBS) $(DELAYIMPORTS:%=-Wb,-d%)
23 24 25

# Rules for installation

26
.PHONY: install_prog install_prog.so install_prog.fake
27

28
install_prog.so: $(MODULE).so $(DESTDIR)$(dlldir) dummy
29
	$(INSTALL_PROGRAM) $(MODULE).so $(DESTDIR)$(dlldir)/$(MODULE).so
30

31 32 33
install_prog.fake: $(MODULE).fake $(DESTDIR)$(fakedlldir) dummy
	$(INSTALL_DATA) $(MODULE).fake $(DESTDIR)$(fakedlldir)/$(MODULE)

34
install_prog: $(MODULE) $(DESTDIR)$(bindir) dummy
35
	$(INSTALL_PROGRAM) $(MODULE) $(DESTDIR)$(bindir)/$(MODULE)
36

37
install install-lib:: install_prog$(DLLEXT) install_prog$(FAKEEXT)
38

39 40
uninstall::
	$(RM) $(DESTDIR)$(bindir)/$(MODULE) $(DESTDIR)$(dlldir)/$(MODULE)$(DLLEXT) $(DESTDIR)$(fakedlldir)/$(MODULE)
41 42

clean::
43
	$(RM) $(MODULE)