diff options
| author | Eli Zaretskii | 2015-11-19 19:49:29 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2015-11-19 19:49:29 +0200 |
| commit | 7cd728c813f2c472a2f6a0cb0c3fb3ee46c9d8ad (patch) | |
| tree | acb3e663b7b9b9464937d5dbe33b88b469b57d5e /modules | |
| parent | d4869dde91a0347697d1f05ac74873c7b86caebb (diff) | |
| download | emacs-7cd728c813f2c472a2f6a0cb0c3fb3ee46c9d8ad.tar.gz emacs-7cd728c813f2c472a2f6a0cb0c3fb3ee46c9d8ad.zip | |
Minor improvements in modules testing Makefile
* modules/mod-test/Makefile (EMACS, SO): New variables.
(CFLAGS): When SO = dll, don't use -fPIC.
(check): New target, runs the test.
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/mod-test/Makefile | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/modules/mod-test/Makefile b/modules/mod-test/Makefile index 654c22a7e33..79a88725d08 100644 --- a/modules/mod-test/Makefile +++ b/modules/mod-test/Makefile | |||
| @@ -18,16 +18,28 @@ | |||
| 18 | # along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | 18 | # along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
| 19 | 19 | ||
| 20 | ROOT = ../.. | 20 | ROOT = ../.. |
| 21 | EMACS = $(ROOT)/src/emacs | ||
| 21 | 22 | ||
| 22 | CC = gcc | 23 | CC = gcc |
| 23 | LD = gcc | 24 | LD = gcc |
| 24 | CFLAGS = -ggdb3 -Wall | ||
| 25 | LDFLAGS = | 25 | LDFLAGS = |
| 26 | 26 | ||
| 27 | all: mod-test.so | 27 | # On MS-Windows, say "make SO=.dll" to build the module |
| 28 | SO = so | ||
| 29 | # -fPIC is a no-op on Windows, but causes a compiler warning | ||
| 30 | ifeq ($(SO),dll) | ||
| 31 | CFLAGS = -ggdb3 -Wall | ||
| 32 | else | ||
| 33 | CFLAGS = -ggdb3 -Wall -fPIC | ||
| 34 | endif | ||
| 35 | |||
| 36 | all: mod-test.$(SO) | ||
| 28 | 37 | ||
| 29 | %.so: %.o | 38 | %.$(SO): %.o |
| 30 | $(LD) -shared $(LDFLAGS) -o $@ $< | 39 | $(LD) -shared $(LDFLAGS) -o $@ $< |
| 31 | 40 | ||
| 32 | %.o: %.c | 41 | %.o: %.c |
| 33 | $(CC) $(CFLAGS) -I$(ROOT)/src -fPIC -c $< | 42 | $(CC) $(CFLAGS) -I$(ROOT)/src -c $< |
| 43 | |||
| 44 | check: | ||
| 45 | $(EMACS) -batch -l ert -l test.el -f ert-run-tests-batch-and-exit | ||