Commit aa67d20cd3fa15296aa7ff72b8d9d922f2442630

Authored by Perry Werneck
1 parent 5136f1eb
Exists in master and in 2 other branches develop, macos

Refactoring Makefile to allow a separated build dir.

Showing 1 changed file with 37 additions and 34 deletions   Show diff stats
Makefile.in
... ... @@ -24,6 +24,23 @@
24 24 # erico.mendonca@gmail.com (Erico Mascarenhas de Mendonça)
25 25 #
26 26  
  27 +#---[ Paths ]----------------------------------------------------------------------------
  28 +
  29 +prefix=@prefix@
  30 +exec_prefix=@exec_prefix@
  31 +srcdir=@srcdir@
  32 +bindir=@bindir@
  33 +srcdir=@srcdir@
  34 +sbindir=@sbindir@
  35 +libdir=@libdir@
  36 +includedir=@includedir@
  37 +datarootdir=@datarootdir@
  38 +localedir=@localedir@
  39 +docdir=@docdir@
  40 +sysconfdir=@sysconfdir@
  41 +datadir=$(datarootdir)/$(PRODUCT_NAME)
  42 +confdir=$(sysconfdir)/$(PRODUCT_NAME)
  43 +
27 44 #---[ Library configuration ]------------------------------------------------------------
28 45  
29 46 SONAME=@SONAME@
... ... @@ -35,22 +52,22 @@ INSTALL_PACKAGES=@INSTALL_PACKAGES@
35 52 NETWORK_MODULES=default openssl
36 53  
37 54 SOURCES= \
38   - $(wildcard src/core/*.c) \
39   - $(wildcard src/core/keyboard/*.c) \
40   - $(wildcard src/core/actions/*.c) \
41   - $(wildcard src/core/toggles/*.c) \
42   - $(wildcard src/core/charset/*.c) \
43   - $(wildcard src/core/ft/*.c) \
44   - $(wildcard src/core/@OSNAME@/*.rc) \
45   - $(wildcard src/core/@OSNAME@/*.c) \
46   - $(wildcard src/core/properties/*.c) \
47   - $(wildcard src/selection/*.c) \
48   - $(wildcard src/network_modules/*.c) \
  55 + $(wildcard $(srcdir)/src/core/*.c) \
  56 + $(wildcard $(srcdir)/src/core/keyboard/*.c) \
  57 + $(wildcard $(srcdir)/src/core/actions/*.c) \
  58 + $(wildcard $(srcdir)/src/core/toggles/*.c) \
  59 + $(wildcard $(srcdir)/src/core/charset/*.c) \
  60 + $(wildcard $(srcdir)/src/core/ft/*.c) \
  61 + $(wildcard $(srcdir)/src/core/@OSNAME@/*.rc) \
  62 + $(wildcard $(srcdir)/src/core/@OSNAME@/*.c) \
  63 + $(wildcard $(srcdir)/src/core/properties/*.c) \
  64 + $(wildcard $(srcdir)/src/selection/*.c) \
  65 + $(wildcard $(srcdir)/src/network_modules/*.c) \
49 66 $(BUILDDIR)/.tmp/$(LIBNAME)/fallbacks.c \
50   - $(foreach MODULE, $(NETWORK_MODULES), $(wildcard src/network_modules/$(MODULE)/*.c))
  67 + $(foreach MODULE, $(NETWORK_MODULES), $(wildcard $(srcdir)/src/network_modules/$(MODULE)/*.c))
51 68  
52 69 TEST_SOURCES= \
53   - $(wildcard src/testprogram/*.c)
  70 + $(wildcard $(srcdir)/src/testprogram/*.c)
54 71  
55 72 #---[ Tools ]----------------------------------------------------------------------------
56 73  
... ... @@ -72,21 +89,7 @@ DOXYGEN=@DOXYGEN@
72 89 DLLTOOL=@DLLTOOL@
73 90 STRIP=@STRIP@
74 91  
75   -#---[ Paths ]----------------------------------------------------------------------------
76   -
77   -prefix=@prefix@
78   -exec_prefix=@exec_prefix@
79   -bindir=@bindir@
80   -srcdir=@srcdir@
81   -sbindir=@sbindir@
82   -libdir=@libdir@
83   -includedir=@includedir@
84   -datarootdir=@datarootdir@
85   -localedir=@localedir@
86   -docdir=@docdir@
87   -sysconfdir=@sysconfdir@
88   -datadir=$(datarootdir)/$(PRODUCT_NAME)
89   -confdir=$(sysconfdir)/$(PRODUCT_NAME)
  92 +#---[ Build Paths ]----------------------------------------------------------------------
90 93  
91 94 BUILDDIR=@BUILDDIR@
92 95  
... ... @@ -105,8 +108,8 @@ BINRLS=$(BINDIR)/Release
105 108 CFLAGS= \
106 109 @CFLAGS@ \
107 110 -g \
108   - -Isrc/include \
109   - -Isrc/include/@OSNAME@ \
  111 + -I$(srcdir)/src/include \
  112 + -I$(srcdir)/src/include/@OSNAME@ \
110 113 @LIBSSL_CFLAGS@ \
111 114 @LDAP_CFLAGS@ \
112 115 @LIBCURL_CFLAGS@
... ... @@ -434,8 +437,8 @@ install-windows-dev: \
434 437 #---[ Misc Targets ]---------------------------------------------------------------------
435 438  
436 439 $(BUILDDIR)/.tmp/$(LIBNAME)/fallbacks.c: \
437   - src/core/X3270.xad \
438   - $(wildcard src/mkfb/*.c)
  440 + $(srcdir)/src/core/X3270.xad \
  441 + $(wildcard $(srcdir)/src/mkfb/*.c)
439 442  
440 443 @$(MKDIR) $(dir $@)
441 444 @$(MKDIR) $(BINDIR)
... ... @@ -446,10 +449,10 @@ $(BUILDDIR)/.tmp/$(LIBNAME)/fallbacks.c: \
446 449 -g \
447 450 -Isrc/include \
448 451 -o $(BINDIR)/mkfb@EXEEXT@ \
449   - $(wildcard src/mkfb/*.c)
  452 + $(wildcard $(srcdir)/src/mkfb/*.c)
450 453  
451 454 @$(BINDIR)/mkfb@EXEEXT@ \
452   - -c src/core/X3270.xad \
  455 + -c $(srcdir)/src/core/X3270.xad \
453 456 $@
454 457  
455 458 locale/$(PACKAGE_NAME).pot: \
... ...