diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2019-07-09 22:34:26 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2019-07-09 22:34:26 +0300 |
commit | 5742ab5a037160a115144b3bf45cf3349df24635 (patch) | |
tree | 85663bc49c6fc3272e014e0addb4bb58aede92bc | |
parent | 4cd8bec42c47c1157e7ea61daf891862264d2c33 (diff) | |
download | wordsplit-5742ab5a037160a115144b3bf45cf3349df24635.tar.gz wordsplit-5742ab5a037160a115144b3bf45cf3349df24635.tar.bz2 |
Modify the VPATH instructions
-rw-r--r-- | README | 24 |
1 files changed, 17 insertions, 7 deletions
@@ -105,23 +105,33 @@ Modify the VPATH variable in your Makefile.am: | |||
105 | 105 | ||
106 | Notice the use of "+=": it is necessary for the vpath builds to work. | 106 | Notice the use of "+=": it is necessary for the vpath builds to work. |
107 | 107 | ||
108 | Add wordsplit.o to the name_LIBADD or name_LDADD variable, depending on | 108 | Define the nodist_program_SOURCES variable: |
109 | the nature of the object being built. | ||
110 | 109 | ||
111 | Modify AM_CPPFLAGS as shown in the previous section: | 110 | nodist_program_SOURCES = wordsplit.c |
112 | 111 | ||
113 | AM_CPPFLAGS = -I$(srcdir)/wordsplit | 112 | The nodist_ prefix is necessary to prevent Make from trying to |
113 | distribute this file from the current directory (where it doesn't | ||
114 | exist of course). It will find it using VPATH during compilation. | ||
114 | 115 | ||
115 | Add both wordsplit/wordsplit.c and wordsplit/wordsplit.h to the EXTRA_DIST | 116 | Finally, add both wordsplit/wordsplit.c and wordsplit/wordsplit.h to |
116 | variable. | 117 | the EXTRA_DIST variable and modify AM_CPPFLAGS as shown in the |
118 | previous section. | ||
117 | 119 | ||
118 | An example Makefile.am: | 120 | An example Makefile.am: |
119 | 121 | ||
120 | program_SOURCES = main.c | 122 | program_SOURCES = main.c |
123 | nodist_program_SOURCES = wordsplit.c | ||
124 | VPATH += $(srcdir)/wordsplit | ||
125 | EXTRA_DIST = wordsplit/wordsplit.c wordsplit/wordsplit.h | ||
126 | AM_CPPFLAGS = -I$(srcdir)/wordsplit | ||
127 | |||
128 | It is also possible to use LDADD as shown in the example below: | ||
129 | |||
130 | program_SOURCES = main.c | ||
121 | LDADD = wordsplit.o | 131 | LDADD = wordsplit.o |
122 | noinst_HEADERS = wordsplit/wordsplit.h | ||
123 | VPATH += $(srcdir)/wordsplit | 132 | VPATH += $(srcdir)/wordsplit |
124 | EXTRA_DIST = wordsplit/wordsplit.c wordsplit/wordsplit.h | 133 | EXTRA_DIST = wordsplit/wordsplit.c wordsplit/wordsplit.h |
134 | AM_CPPFLAGS = -I$(srcdir)/wordsplit | ||
125 | 135 | ||
126 | * The testsuite | 136 | * The testsuite |
127 | 137 | ||