File: Makefile.module.in

package info (click to toggle)
gnucobol3 3.2-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 30,032 kB
  • sloc: sh: 201,859; ansic: 99,735; yacc: 18,930; lex: 5,521; cobol: 1,078; makefile: 593; perl: 555; awk: 184; sed: 16
file content (113 lines) | stat: -rw-r--r-- 3,169 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#
# Makefile gnucobol/tests/cobol85/##MODULE##
#
# Copyright (C) 2002-2012, 2015-2020, 2022-2023 Free Software Foundation, Inc.
# Written by Keisuke Nishida, Roger While, Simon Sobisch
#
# This file is part of GnuCOBOL.
#
# The GnuCOBOL compiler is free software: you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# GnuCOBOL is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GnuCOBOL.  If not, see <https://www.gnu.org/licenses/>.

TESTS = ##TESTS##
TESTS_LOCAL = ##TESTS_LOCAL##

RM = rm -rf
DIFF_FLAGS = ##DIFF_FLAGS##

PERL = ##PERL##

all:
	@$(MAKE) test
	@$(MAKE) diff
#	@$(MAKE) test-O
#	@$(MAKE) diff
	@echo

all-local:
	@$(MAKE) test-local
	@$(MAKE) diff
#	@$(MAKE) test-O-local
#	@$(MAKE) diff
	@echo

# targets that are only logical targets instead of files
# note: this special target is not mandated by POSIX
.PHONY: test test-local diff test-O test-O-local libs libs-local \
        $(TESTS) $(TESTS_LOCAL) \
        clean-log clean-db clean-debug clean-bin

# note: these targets use the autotest setup files atconfig and atlocal which
#       ensures to use the same test environment as in the testsuite

test:
	@. ../../atconfig && . ../../atlocal && $(MAKE) $@-local

test-local:
	@echo
	@echo "Performing tests for module directory ##MODULE##"
	@$(PERL) ##COB85DIR##/report.pl

diff: report.txt
	@echo
	@echo "Comparing test results for module directory ##MODULE##"
	@diff $(DIFF_FLAGS) ##COB85DIR##/##MODULE##.txt report.txt || true

test-O:
	@. ../../atconfig && . ../../atlocal && $(MAKE) $@-local

test-O-local:
	@echo
	@echo "Performing tests (optimized) for module directory ##MODULE##"
	@$(PERL) ##COB85DIR##/report.pl -O

# TODO: use option similar to automake making the lib target conditional on
# its existence via @HAS_LIBS@ which we'd sed away
libs:
	@if test -d lib; then                                                        \
	 . ../../atconfig && . ../../atlocal && $(MAKE) $@-local; \
	fi

libs-local:
	@if test -d lib; then                                     \
	 echo ""                                                 ; \
	 echo "Compiling libs for module directory ##MODULE##...";  \
	 $(PERL) ##COB85DIR##/report.pl lib                         ;   \
	fi

$(TESTS): libs

$(TESTS):
	@. ../../atconfig && . ../../atlocal && $(MAKE) $@-local

$(TESTS_LOCAL): libs-local
	@echo "Running single test `echo $@ | sed -e 's|-.*||g'`"
	@$(PERL) ##COB85DIR##/report.pl `echo $@ | sed -e 's|-.*||g'` 2>$@.log
	@grep `echo $@ | sed -e 's|-.*||g'` ##COB85DIR##/##MODULE##.txt | diff - $@.log
	@rm -rf $@.log

clean: clean-log clean-db clean-debug clean-bin
	$(RM) *.txt

clean-log:
	$(RM) *.log *.out

clean-bin:
	$(RM) *.so *.dll *.exe
	$(RM) $(TESTS)

clean-debug:
	$(RM) *.i *.c *.c.*

clean-db:
	$(RM) __db.*