Makeprog.rules.in 1.88 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        = $(EXTRADEFS)
14
ALL_LIBS    = $(DELAYIMPORTS:%=-l%) $(IMPORTS:%=-l%) $(EXTRALIBS) $(LIBPORT) $(LDFLAGS) $(LIBS)
15
BASEMODULE  = $(MODULE:.exe=)
16
RUNTESTFLAGS= -q -P wine -T $(TOPOBJDIR)
17
INSTALLDIRS = $(DESTDIR)$(bindir) $(DESTDIR)$(dlldir) $(DESTDIR)$(mandir)/man$(prog_manext)
18 19 20

@MAKE_RULES@

21
all: $(MODULE)$(DLLEXT) $(BASEMODULE)$(EXEEXT)
22 23

# Rules for .so main module
24

25
$(MODULE).so: $(OBJS) $(RC_SRCS:.rc=.res) Makefile.in
26
	$(WINEGCC) $(APPMODE) $(OBJS) $(RC_SRCS:.rc=.res) -o $@ $(ALL_LIBS) $(DELAYIMPORTS:%=-Wb,-d%)
27

28 29
$(BASEMODULE): $(WINEWRAPPER)
	$(RM) $@ && $(LN_S) $(WINEWRAPPER) $@
30

31 32
# Rules for .exe main module

33
$(MODULE): $(OBJS) $(RCOBJS) Makefile.in
34
	$(CC) $(APPMODE) $(OBJS) $(RCOBJS) -o $@ -L$(DLLDIR) $(IMPORTS:%=-L$(DLLDIR)/%) $(DELAYIMPORTS:%=-L$(DLLDIR)/%) $(LIBWINE) $(ALL_LIBS)
35

36 37
# Rules for testing

38 39 40
check test:: $(SUBDIRS:%=%/__test__)

$(TESTRESULTS): $(MODULE)$(DLLEXT)
41

42 43
# Rules for installation

44
.PHONY: install_prog install_prog.so uninstall_prog uninstall_prog.so
45

46
install_prog.so: $(MODULE).so $(DESTDIR)$(dlldir) dummy
47
	$(INSTALL_PROGRAM) $(MODULE).so $(DESTDIR)$(dlldir)/$(MODULE).so
48

49
install_prog: $(MODULE) $(DESTDIR)$(bindir) dummy
50
	$(INSTALL_PROGRAM) $(MODULE) $(DESTDIR)$(bindir)/$(MODULE)
51

52
uninstall_prog.so: dummy
53
	$(RM) $(DESTDIR)$(dlldir)/$(MODULE).so
54 55

uninstall_prog: dummy
56
	$(RM) $(DESTDIR)$(bindir)/$(MODULE)
57

58
install install-lib:: install_prog$(DLLEXT)
59

60
uninstall:: uninstall_prog$(DLLEXT)
61 62

clean::
63
	$(RM) $(BASEMODULE) $(MODULE)