forked from RefPerSys/RefPerSys
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGNUmakefile
More file actions
802 lines (686 loc) · 35.8 KB
/
Copy pathGNUmakefile
File metadata and controls
802 lines (686 loc) · 35.8 KB
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
#!/usr/bin/gmake
## SPDX-License-Identifier: GPL-3.0-or-later
## Description:
## This file is part of the Reflective Persistent System. refpersys.org
##
## It is its GNUmakefile, for the GNU make automation builder.
##
## Author(s):
## Basile STARYNKEVITCH, France, <basile@starynkevitch.net>
## Abhishek Chakravarti <abhishek@taranjali.org>
## Nimesh Neema <nimeshneema@gmail.com>
## Abdullah Siddiqui <siddiquiabdullah92@gmail.com>
##
## © Copyright 2019 - 2025 The Reflective Persistent System Team
## team@refpersys.org
##
## License:
## This program 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.
##
## This program 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 this program. If not, see <http://www.gnu.org/licenses/>
## tell GNU make to export all variables by default
export
RPS_GIT_ID:= $(shell ./rps-generate-gitid.sh)
RPS_SHORTGIT_ID:= $(shell ./rps-generate-gitid.sh -s)
# GNU make builder, see www.gnu.org/software/make/
RPS_MAKE:= $(MAKE)
# GNU bison parser generator from www.gnu.org/software/bison/
RPS_BISON := bison
# bisonc++ is another parser generator by Frank B. Brokken on
# fbb-git.gitlab.io/bisoncpp/
RPS_BISONCPP := bisonc++
RPS_HOST := $(shell /bin/hostname -f)
RPS_ARCH := $(shell /bin/uname -m)
RPS_OPERSYS := $(shell /bin/uname -o | /bin/sed 1s/[^a-zA-Z0-9_]/_/g )
RPS_ATSHARP := $(shell printf '@#')
RPS_HOMETMP := $(shell echo '$$HOME/tmp')
# Carburetta is a parser generator on github.com/kingletbv/carburetta
RPS_CARBURETTA := $(shell /usr/bin/which carburetta)
## REFPERSYS_LTO is by convention for link-time optimization flags
#
.DEFAULT_GOAL: refpersys
.PHONY: all config objects showtests clean distclean gitpush gitpush2 \
print-plugin-settings indent redump clean-plugins plugins \
print-gmake-features \
one-plugin \
lto-refpersys \
snapshot \
test00 test01 test01a test01b test01c test01d test01e test01f \
test02 test03 test03nt test04 \
test05 test06 test07 test07a \
test08 test09 test-load \
testcarb1 testcarb2 testcarb3 \
testfltk1 testfltk2 testfltk3 testfltk4
SYNC=/bin/sync
## a formatter to restrict width to 75 columns
FMT=/usr/bin/fmt
## a C and C++ indenter and its flags
ASTYLE=/usr/bin/astyle
ASTYLEFLAGS= --verbose --style=gnu --indent=spaces=2 --convert-tabs
-include _config-refpersys.mk
CFLAGS?= -O -g -Wall $(RPS_LTO)
### Human hand-written C++ sources
REFPERSYS_HUMAN_CPP_SOURCES=$(wildcard *_rps.cc)
### corresponding object files
REFPERSYS_HUMAN_CPP_OBJECTS=$(patsubst %.cc, %.o, $(REFPERSYS_HUMAN_CPP_SOURCES))
### Generated C++ sources which are written at dump time and needs to be git managed
REFPERSYS_GENERATED_CPP_SOURCES := $(wildcard generated/*.cc)
### corresponding object files
REFPERSYS_GENERATED_CPP_OBJECTS=$(patsubst %.cc, %.o, $(REFPERSYS_GENERATED_CPP_SOURCES))
## altredump is dumping into....
RPS_ALTDUMPDIR_PREFIX?= /tmp/refpersys-$(RPS_SHORTGIT_ID)
## Ian Lance Taylor libbacktrace is often in GCC
ifndef RPS_LIBBACKTRACE
RPS_LIBBACKTRACE := -D_Rps_libBacktrace_from_=\"$(REFPERSYS_CXX)\" $(shell $(REFPERSYS_CXX) -print-file-name=libbacktrace.a)
else
RPS_LIBBACKTRACE := -D_Rps_libBacktrace_plain_ -lbacktrace
endif
### required libraries not being known to pkg-config
## unistring is https://www.gnu.org/software/libunistring/
## backtrace is https://github.com/ianlancetaylor/libbacktrace (also inside GCC source)
## libgccjit is from https://gcc.gnu.org/onlinedocs/jit/
## try using GNU lightning is from https://www.gnu.org/software/lightning/ (for machine code generation)
REFPERSYS_NEEDED_LIBRARIES= -llightning -lunistring -lgmp
## TODO after june 2024, add the libgccjit...
### desired plugins (their basename under plugins_dir/)
### Basile removed _rpsplug_gramrepl in sept. 2024
### and removed rpsplug_simpinterp in march 2025
REFPERSYS_DESIRED_PLUGIN_BASENAMES= \
rpsplug_createclass \
rpsplug_createnamedattribute \
rpsplug_createnamedselector \
rpsplug_create_cplusplus_primitive_type \
rpsplug_createdelim
## perhaps add after Feb. 2025 a plugin generated by Carburetta? https://carburetta.com/
all:
@if [ -z "$(REFPERSYS_TOPDIR)" ]; then \
REFPERSYS_TOPDIR="$(pwd)"; \
/usr/bin/printf "missing REFPERSYS_TOPDIR, using default\n" > /dev/stderr; \
fi
@/usr/bin/printf 'RPS_HOMETMP is %s\n' "$(RPS_HOMETMP)"
@/usr/bin/printf "make features: %s\n" "$(.FEATURES)" | $(FMT)
$(MAKE) tools/do-configure-refpersys
@/usr/bin/printf "hand-written C++ code: %s\n" "$(REFPERSYS_HUMAN_CPP_SOURCES)" | $(FMT)
@if [ ! -f _config-refpersys.mk ]; then \
echo missing _config-refpersys.mk for GNUmakefile > /dev/stderr; \
echo run $(MAKE) config > /dev/stderr ; \
exit 1 ; \
fi
$(MAKE) refpersys
$(MAKE) do-build-refpersys-plugin
@/usr/bin/printf "\n\n\nMaking RefPerSys plugins\n\n"
$(MAKE) plugins
objects: $(REFPERSYS_HUMAN_CPP_OBJECTS) $(REFPERSYS_GENERATED_CPP_OBJECTS) __timestamp.o _carbrepl_rps.o
.SECONDARY: __timestamp.c
$(SYNC)
snapshot: clean
$(MAKE) __timestamp.c
/bin/tar -cjf $$HOME/tmp/refpersys-snapshot.tar.bz2 -C .. RefPerSys
lto-refpersys:
$(MAKE) clean
$(MAKE) -j3 REFPERSYS_LTO=-flto objects
$(REFPERSYS_CXX) -flto -rdynamic \
$(REFPERSYS_COMPILER_FLAGS) \
$(REFPERSYS_LINKER_FLAGS) \
-o $@ \
$(REFPERSYS_HUMAN_CPP_OBJECTS) \
$(REFPERSYS_GENERATED_CPP_OBJECTS) __timestamp.o \
$(RPS_LIBBACKTRACE) \
$(shell $(REFPERSYS_FLTKCONFIG) -g --ldflags) \
-L/usr/local/lib $(REFPERSYS_NEEDED_LIBRARIES) \
$(REFPERSYS_LINKER_FLAGS) \
$(shell pkg-config --libs $(sort $(PACKAGES_LIST))) -ldl
config: tools/do-configure-refpersys do-scan-refpersys-pkgconfig GNUmakefile
tools/do-configure-refpersys
$(MAKE) _scanned-pkgconfig.mk
#### the configurator tool
tools/do-configure-refpersys: tools/do-configure-refpersys.c |GNUmakefile rps-generate-gitid.sh
$(CC) -Wall -Wextra -DRPSCONF_GIT_ID=\"$(shell ./rps-generate-gitid.sh -s)\" \
-DRPSCONF_OPERSYS=\"$(RPS_OPERSYS)\" \
-DRPSCONF_ARCH=\"$(RPS_ARCH)\" \
-DRPSCONF_HOST=\"$(RPS_HOST)\" \
$(CFLAGS) $^ -o $@ -lgccjit -lreadline -lncurses -ldl
## If GNU readline library is unavailable add
## -DRPSCONF_WITHOUT_READLINE above and remove the -lreadline above.
##
## If GNU ncurses library is unavailable add -DRPSCONF_WITHOUT_NCURSES
## above and remove the -lncurses above.
##
## If libgccjit (see https://gcc.gnu.org/onlinedocs/jit/ ...) is
## unavailable add -DRPSCONF_WITHOUT_GCCJIT
######
do-scan-refpersys-pkgconfig: do-scan-refpersys-pkgconfig.c |GNUmakefile rps-generate-gitid.sh
$(CC) -Wall -Wextra -DGIT_ID=\"$(shell ./rps-generate-gitid.sh -s)\" \
$(CFLAGS) $^ -o $@
do-build-refpersys-plugin: do-build-refpersys-plugin.cc __timestamp.c
$(CXX) -Wall -Wextra -DGIT_ID=\"$(shell ./rps-generate-gitid.sh -s)\" $(CFLAGS) $(shell pkg-config --cflags guile-3.0) -g $^ -o $@ $(shell pkg-config --libs guile-3.0)
clean: clean-plugins
$(RM) tmp* *~ *.o
# $(RM) -v _gramrepl_rps.*
$(RM) -v _carbrepl_rps.*
$(RM) -v _bispprepl_rps* bispprepl_rps.yyp.output
$(RM) do-scan-refpersys-pkgconfig tools/do-configure-refpersys do-build-refpersys-plugin
$(RM) refpersys lto-refpersys
$(RM) *% %~
$(RM) *.gch
$(RM) *.orig
$(RM) */*~ */*% */*.orig
$(RM) */*.so
$(RM) *.ii
$(RM) core*
$(RM) Make-dependencies/__*
_bispprepl_rps.cc _bispprepl_rps.hh: bispprepl_rps.yyp |GNUmakefile
$(RPS_BISONCPP) --verbose --thread-safe --show-filenames \
--baseclass-preinclude=refpersys.hh \
--parsefun-source=_bispprepl_rps.cc \
$^
_carbrepl_rps.cc: carbrepl_rps.cbrt |GNUmakefile $(RPS_CARBURETTA)
# the --sym-names feature of carburetta is in
# https://github.com/kingletbv/carburetta/issues/9
$(RPS_CARBURETTA) --c _carbrepl_rps.cc --sym-names $^
# dont indent because of #line-s
# $(ASTYLE) $(ASTYLEFLAGS) _carbrepl_rps.cc
clean-plugins:
$(RM) -v plugins_dir/*.o
$(RM) -v plugins_dir/*.so
$(RM) -v plugins_dir/_*
$(RM) -v _rpsplug* */_rpsplug*
$(RM) -v plugins_dir/rpsplug_synsimpinterp.gv
$(RM) -v plugins_dir/rpsplug_synsimpinterp.hh
$(RM) -v plugins_dir/rpsplug_synsimpinterp.cc
$(RM) -v plugins_dir/rpsplug_synsimpinterp.html
$(RM) -v plugins_dir/rpsplug_synsimpinterp.output
$(RM) -v plugins_dir/rpsplug_synsimpinterp.xml
$(RM) -v plugins_dir/location.hh
$(RM) -v plugins_dir/rpsplug_synsimpinterp.yy.output
distclean: clean
$(RM) build.time _config-refpersys.mk _scanned-pkgconfig.mk __timestamp.*
$(RM) __*.mkdep Make-dependencies/__*.mkdep
$(RM) do-scan-refpersys-pkgconfig
-include _scanned-pkgconfig.mk
-include $(wildcard Make-dependencies/__*.mkdep)
_scanned-pkgconfig.mk: $(REFPERSYS_HUMAN_CPP_SOURCES) |GNUmakefile do-scan-refpersys-pkgconfig
./do-scan-refpersys-pkgconfig refpersys.hh $(REFPERSYS_HUMAN_CPP_SOURCES) > $@
__timestamp.c: rps-generate-timestamp.sh GNUmakefile $(wildcard *.cc *.hh generated/*.cc generated *.hh)
@echo MAKE is "$(MAKE)" CXX is "$(REFPERSYS_CXX)" GPP is "$(REFPERSYS_GPP)" and "$(GPP)"
+env "MAKE=$(shell /bin/which gmake)" "CXX=$(REFPERSYS_CXX)" "GPP=$(REFPERSYS_GPP)" "CXXFLAGS=$(REFPERSYS_PREPRO_FLAGS) $(REFPERSYS_COMPILER_FLAGS)" ./rps-generate-timestamp.sh $@ > $@
__timestamp.o: __timestamp.c |GNUmakefile
$(CC) -std=gnu23 -fPIC $(RPS_LTO) -c -O -g -Wall -DGIT_ID=\"$(shell ./rps-generate-gitid.sh -s)\" $^ -o $@
#was
#refpersys: $(REFPERSYS_HUMAN_CPP_OBJECTS) \
# $(REFPERSYS_GENERATED_CPP_OBJECTS) \
# __timestamp.c | GNUmakefile
refpersys: objects | GNUmakefile _config-refpersys.mk
$(MAKE) __timestamp.o
@if [ -z "$(REFPERSYS_CXX)" ]; then echo should make config ; exit 1; fi
/bin/sleep 0.05
$(MAKE) objects
/bin/sleep 0.05
@echo RefPerSys human C++ source files $(REFPERSYS_HUMAN_CPP_SOURCES)
# @echo RefPerSys human C++ object files $(REFPERSYS_HUMAN_CPP_OBJECTS)
@echo RefPerSys generated C++ files $(REFPERSYS_GENERATED_CPP_SOURCES)
# @echo RefPerSys generated C++ object files $(REFPERSYS_GENERATED_CPP_OBJECTS)
@echo PACKAGES_LIST is $(PACKAGES_LIST)
@echo RPS_LTO is $(RPS_LTO)
@echo FLTKconfig is $(REFPERSYS_FLTKCONFIG)
@echo FLTK stuff is $(shell $(REFPERSYS_FLTKCONFIG) -g --ldflags)
@echo REFPERSYS_NEEDED_LIBRARIES is $(REFPERSYS_NEEDED_LIBRARIES)
@echo REFPERSYS_HUMAN_CPP_OBJECTS is $(REFPERSYS_HUMAN_CPP_OBJECTS) | /usr/bin/fmt | /bin/sed '2,$$s/^/ /'
@echo REFPERSYS_GENERATED_CPP_OBJECTS is $(REFPERSYS_GENERATED_CPP_OBJECTS) | /usr/bin/fmt | /bin/sed '2,$$s/^/ /'
$(MAKE) RPS_LTO=$(RPS_LTO) $(REFPERSYS_HUMAN_CPP_OBJECTS) $(REFPERSYS_GENERATED_CPP_OBJECTS) __timestamp.o
@if [ -x $@ ]; then /bin/mv -v --backup $@ $@~ ; fi
-@echo Linking $@
$(REFPERSYS_CXX) $(RPS_LTO) -rdynamic -o $@ \
$(REFPERSYS_HUMAN_CPP_OBJECTS) \
$(REFPERSYS_GENERATED_CPP_OBJECTS) \
__timestamp.o \
$(RPS_LIBBACKTRACE) \
$(shell $(REFPERSYS_FLTKCONFIG) -g --ldflags) \
-L/usr/local/lib $(REFPERSYS_NEEDED_LIBRARIES) \
$(REFPERSYS_LINKER_FLAGS) \
$(shell pkg-config --libs $(sort $(PACKAGES_LIST))) -ldl
-@echo Linked $@
%.ii: %.cc | refpersys.hh GNUmakefile _config-refpersys.mk
plugins: |GNUmakefile do-build-refpersys-plugin do-scan-refpersys-pkgconfig
@printf "\n\n making plugins desired basenames=%s\n" "$(REFPERSYS_DESIRED_PLUGIN_BASENAMES)"
+$(MAKE) $(patsubst %, plugins_dir/%.so, $(REFPERSYS_DESIRED_PLUGIN_BASENAMES))
define RPS_GUILE_SCRIPT
;; Scheme function for GUILE
;; www.gnu.org/software/guile/manual/html_node/
(use-modules (ice-9 textual-ports))
(use-modules (ice-9 format))
(define rpsg-stdout (current-output-port))
(define (rpsguilemk-compile-plugin cppsrc plugobj)
;; temporary guile code
;; cppsrc is the C++ source file of the plugin
;; plugobj is the generated shared object
(format #t "rpsguilemk-compile-plugin cppsrc=~S plugob=~S\n"
cppsrc plugobj)
)
endef
$(guile $(RPS_GUILE_SCRIPT))
one-plugin: refpersys | GNUmakefile do-build-refpersys-plugin do-scan-refpersys-pkgconfig
$(guile rpsguilemk-compile-plugin $(REFPERSYS_PLUGIN_SOURCE) $(REFPERSYS_PLUGIN_SHARED_OBJECT))
$(REFPERSYS_CXX) $(REFPERSYS_PREPRO_FLAGS) -fPIC -shared $(REFPERSYS_CODEGEN_FLAGS) \
-I generated/ -I . $(shell pkg-config --cflags jsoncpp) \
-DRPS_SHORTGIT=\"$(RPS_SHORTGIT_ID)\" \
-DRPS_GITID=\"$(RPS_GIT_ID)\" \
-DRPS_HOST=\"$(RPS_HOST)\" \
-DRPS_BASENAME=\"$(notdir $(basename $(REFPERSYS_PLUGIN_SOURCE)))\" \
-DRPS_ARCH=\"$(RPS_ARCH)\" -DRPS_HAS_ARCH_$(RPS_ARCH) \
-DRPS_OPERSYS=\"$(RPS_OPERSYS)\" -DRPS_HAS_OPERSYS_$(RPS_OPERSYS) \
$(REFPERSYS_PLUGIN_SOURCE) -o $(REFPERSYS_PLUGIN_SHARED_OBJECT)
plugins_dir/rpsplug_createclass.so: plugins_dir/rpsplug_createclass.cc refpersys.hh |GNUmakefile refpersys
@printf "\n\nRefPerSys-gnumake building special plugin %s from source %s in %s\n" "$@" "$<" "$$(/bin/pwd)"
$(REFPERSYS_CXX) $(REFPERSYS_PREPRO_FLAGS) -fPIC -shared $(REFPERSYS_CODEGEN_FLAGS) \
-I generated/ -I . $(shell pkg-config --cflags jsoncpp) \
-DRPS_SHORTGIT=\"$(RPS_SHORTGIT_ID)\" \
-DRPS_GITID=\"$(RPS_GIT_ID)\" \
-DRPS_HOST=\"$(RPS_HOST)\" \
-DRPS_BASENAME=\"$(notdir $(basename $<))\" \
-DRPS_ARCH=\"$(RPS_ARCH)\" -DRPS_HAS_ARCH_$(RPS_ARCH) \
-DRPS_OPERSYS=$(RPS_OPERSYS) -DRPS_HAS_OPERSYS_$(RPS_OPERSYS) \
$^ -o $@
plugins_dir/rpsplug_cplusplustypes.so: plugins_dir/rpsplug_cplusplustypes.cc refpersys.hh |GNUmakefile refpersys
@printf "\n\nRefPerSys-gnumake building special plugin %s from source %s in %s\n" "$@" "$<" "$$(/bin/pwd)"
$(REFPERSYS_CXX) $(REFPERSYS_PREPRO_FLAGS) -fPIC -shared $(REFPERSYS_CODEGEN_FLAGS) \
-I generated/ -I . $(shell pkg-config --cflags jsoncpp) \
-DRPS_SHORTGIT=\"$(RPS_SHORTGIT_ID)\" \
-DRPS_GITID=\"$(RPS_GIT_ID)\" \
-DRPS_HOST=\"$(RPS_HOST)\" \
-DRPS_BASENAME=\"$(notdir $(basename $(<F)))\" \
-DRPS_ARCH=\"$(RPS_ARCH)\" -DRPS_HAS_ARCH_$(RPS_ARCH) \
-DRPS_OPERSYS=$(RPS_OPERSYS) -DRPS_HAS_OPERSYS_$(RPS_OPERSYS) \
$^ -o $@
plugins_dir/rpsplug_createnamedselector.so: plugins_dir/rpsplug_createnamedselector.cc refpersys.hh |GNUmakefile refpersys
@printf "\n\nRefPerSys-gnumake building special plugin %s from source %s in %s\n" "$@" "$<" "$$(/bin/pwd)"
$(REFPERSYS_CXX) $(REFPERSYS_PREPRO_FLAGS) -fPIC -shared $(REFPERSYS_CODEGEN_FLAGS) \
-I generated/ -I . $(shell pkg-config --cflags jsoncpp) \
-DRPS_SHORTGIT=\"$(RPS_SHORTGIT_ID)\" \
-DRPS_GITID=\"$(RPS_GIT_ID)\" \
-DRPS_HOST=\"$(RPS_HOST)\" \
-DRPS_BASENAME=\"$(notdir $(basename $(<F)))\" \
-DRPS_ARCH=\"$(RPS_ARCH)\" -DRPS_HAS_ARCH_$(RPS_ARCH) \
-DRPS_OPERSYS=$(RPS_OPERSYS) -DRPS_HAS_OPERSYS_$(RPS_OPERSYS) \
$^ -o $@
plugins_dir/rpsplug_createnamedattribute.so: plugins_dir/rpsplug_createnamedattribute.cc refpersys.hh |GNUmakefile refpersys
@printf "\n\nRefPerSys-gnumake building special plugin %s from source %s in %s\n" "$@" "$<" "$$(/bin/pwd)"
$(REFPERSYS_CXX) $(REFPERSYS_PREPRO_FLAGS) -fPIC -shared $(REFPERSYS_CODEGEN_FLAGS) \
-I generated/ -I . $(shell pkg-config --cflags jsoncpp) \
-DRPS_SHORTGIT=\"$(RPS_SHORTGIT_ID)\" \
-DRPS_GITID=\"$(RPS_GIT_ID)\" \
-DRPS_HOST=\"$(RPS_HOST)\" \
-DRPS_BASENAME=\"$(notdir $(basename $(<F)))\" \
-DRPS_ARCH=\"$(RPS_ARCH)\" -DRPS_HAS_ARCH_$(RPS_ARCH) \
-DRPS_OPERSYS=$(RPS_OPERSYS) -DRPS_HAS_OPERSYS_$(RPS_OPERSYS) \
$^ -o $@
plugins_dir/rpsplug_createsymbol.so: plugins_dir/rpsplug_createsymbol.cc refpersys.hh |GNUmakefile refpersys
@printf "\n\nRefPerSys-gnumake building special plugin %s from source %s in %s\n" "$@" "$<" "$$(/bin/pwd)"
$(REFPERSYS_CXX) $(REFPERSYS_PREPRO_FLAGS) -fPIC -shared $(REFPERSYS_CODEGEN_FLAGS) \
-I generated/ -I . $(shell pkg-config --cflags jsoncpp) \
-DRPS_SHORTGIT=\"$(RPS_SHORTGIT_ID)\" \
-DRPS_GITID=\"$(RPS_GIT_ID)\" \
-DRPS_HOST=\"$(RPS_HOST)\" \
-DRPS_BASENAME=\"$(notdir $(basename $(<F)))\" \
-DRPS_ARCH=\"$(RPS_ARCH)\" -DRPS_HAS_ARCH_$(RPS_ARCH) \
-DRPS_OPERSYS=$(RPS_OPERSYS) -DRPS_HAS_OPERSYS_$(RPS_OPERSYS) \
$^ -o $@
plugins_dir/rpsplug_create_cplusplus_primitive_type.so: plugins_dir/rpsplug_create_cplusplus_primitive_type.cc refpersys.hh |GNUmakefile refpersys
@printf "\n\nRefPerSys-gnumake building special plugin %s from source %s in %s\n" "$@" "$<" "$$(/bin/pwd)"
$(REFPERSYS_CXX) $(REFPERSYS_PREPRO_FLAGS) -fPIC -shared $(REFPERSYS_CODEGEN_FLAGS) \
-I generated/ -I . $(shell pkg-config --cflags jsoncpp) \
-DRPS_SHORTGIT=\"$(RPS_SHORTGIT_ID)\" \
-DRPS_GITID=\"$(RPS_GIT_ID)\" \
-DRPS_GITID=\"$(RPS_GIT_ID)\" \
-DRPS_HOST=\"$(RPS_HOST)\" \
-DRPS_BASENAME=\"$(notdir $(basename $(<F)))\" \
-DRPS_ARCH=\"$(RPS_ARCH)\" -DRPS_HAS_ARCH_$(RPS_ARCH) \
-DRPS_OPERSYS=$(RPS_OPERSYS) -DRPS_HAS_OPERSYS_$(RPS_OPERSYS) \
$^ -o $@
#- plugins_dir/rpsplug_simpinterp.so: plugins_dir/rpsplug_simpinterp.cc _rpsplug_synsimpinterp_parser_.cc refpersys.hh |GNUmakefile refpersys
#- @printf "\n\nRefPerSys-gnumake building special plugin %s from source %s in %s\n" "$@" "$<" "$$(/bin/pwd)"
#- $(REFPERSYS_CXX) $(REFPERSYS_PREPRO_FLAGS) -fPIC -shared $(REFPERSYS_CODEGEN_FLAGS) \
#- -I generated/ -I . $(shell pkg-config --cflags jsoncpp) \
#- -DRPS_SHORTGIT=\"$(RPS_SHORTGIT_ID)\" \
#- -DRPS_GITID=\"$(RPS_GIT_ID)\" \
#- -DRPS_GITID=\"$(RPS_GIT_ID)\" \
#- -DRPS_HOST=\"$(RPS_HOST)\" \
#- -DRPS_BASENAME=\"$(notdir $(basename $(<F)))\" \
#- -DRPS_ARCH=\"$(RPS_ARCH)\" -DRPS_HAS_ARCH_$(RPS_ARCH) \
#- -DRPS_OPERSYS=$(RPS_OPERSYS) -DRPS_HAS_OPERSYS_$(RPS_OPERSYS) \
#- plugins_dir/rpsplug_simpinterp.cc _rpsplug_synsimpinterp_parser_.cc -o $@
plugins_dir/%.so: plugins_dir/%.cc refpersys.hh |GNUmakefile do-build-refpersys-plugin
@printf "\n\nRefPerSys-gnumake building plugin %s from source %s in %s\n" "$@" "$<" "$$(/bin/pwd)"
@printf "RPS_MAKE is %s and MAKE is %s for refpersys plugin at=%s PATH=%s\n" \ "$(RPS_MAKE)" "$(MAKE)" "$@" "$$PATH"
# env PATH=$$PATH $(shell $(RPS_MAKE) -s print-plugin-settings) /usr/bin/printenv
# env PATH=$$PATH $(shell $(RPS_MAKE) -s print-plugin-settings) ./do-build-refpersys-plugin -v $< -o $@
/usr/bin/printenv
$(REFPERSYS_CXX) $(REFPERSYS_PREPRO_FLAGS) -fPIC -shared $(REFPERSYS_CODEGEN_FLAGS) \
-I generated/ -I . $(shell pkg-config --cflags jsoncpp) \
-DRPS_SHORTGIT=\"$(RPS_SHORTGIT_ID)\" \
-DRPS_GITID=\"$(RPS_GIT_ID)\" \
-DRPS_HOST=\"$(RPS_HOST)\" \
-DRPS_BASENAME=\"$(notdir $(basename $(<F)))\" \
-DRPS_ARCH=\"$(RPS_ARCH)\" -DRPS_HAS_ARCH_$(RPS_ARCH) \
-DRPS_OPERSYS=$(RPS_OPERSYS) -DRPS_HAS_OPERSYS_$(RPS_OPERSYS) \
$< -o $@
################################# obsolete stuff
# _rpsplug_synsimpinterp_parser_.cc: plugins_dir/rpsplug_synsimpinterp.yy |GNUmakefile
# $(RPS_BISONCPP) --verbose --show-filenames \
# --thread-safe \
# --skeleton-directory=plugins_dir/bisonc++-skeletons/ \
# $<
#plugins_dir/_rpsplug_gramrepl.yy: plugins_dir/gramrepl_rps.yy.gpp refpersys.hh refpersys |GNUmakefile _config-refpersys.mk _scanned-pkgconfig.mk
# @printf "RefPerSys-gnumake building plugin GNU bison code %s from %s using $(REFPERSYS_GPP) in %s\n" "$@" "$<" "$$(/bin/pwd)"
# $(REFPERSYS_GPP) -x -I generated/ -I . \
# -DRPS_SHORTGIT=\"$(RPS_SHORTGIT_ID)\" \
# -DRPS_GITID=\"$(RPS_GIT_ID)\" \
# -DRPS_HOST=\"$(RPS_HOST)\" \
# -DRPS_ARCH=\"$(RPS_ARCH)\" -DRPS_HAS_ARCH_$(RPS_ARCH) \
# -DRPS_OPERSYS=$(RPS_OPERSYS) -DRPS_HAS_OPERSYS_$(RPS_OPERSYS) \
# -DRPS_GPP_INPUT="$<" -DRPS_GPP_OUTPUT="$@" \
# -DRPS_BASENAME=\"$(notdir $(basename $(<F)))\" \
# -DRPS_GPP_INPUT_BASENAME="$(basename $<)" \
# -U '@&' '&@' '(' '&,' ')' '(' ')' '$(RPS_ATSHARP)' '\\' \
# -o $@ $<
#
#
#plugins_dir/_rpsplug_gramrepl.cc: plugins_dir/_rpsplug_gramrepl.yy
# $(RPS_BISON) --verbose --no-lines --warnings=all --color=tty \
# --language=c++ --debug --token-table \
# --header=plugins_dir/_rpsplug_gramrepl.hh \
# -DRPS_GPP_INPUT_BASENAME="$(basename $<)" \
# --output=$@ \
# $<
################################
# Target to facilitate git push to both origin and GitHub mirrors
gitpush:
@echo RefPerSys git pushing.... ; grep -2 url .git/config
@git push origin
ifeq ($(shell git remote | grep github), github)
@git push github
else
@echo "Add github remote as git@github.com:RefPerSys/RefPerSys.git"
@printf "using: %s\n" 'git remote add --mirror=push github git@github.com:RefPerSys/RefPerSys.git'
endif
@printf "\n%s git-pushed commit %s of RefPerSys, branch %s ...\n" \
"$$(git config --get user.email)" "$$(./rps-generate-gitid.sh -s)" "$$(git branch | fgrep '*')"
@git log -1 --format=oneline --abbrev=12 --abbrev-commit -q | head -1
if [ -x $$HOME/bin/push-refpersys ]; then $$HOME/bin/push-refpersys $(shell /bin/pwd) $(RPS_SHORTGIT_ID); fi
$(SYNC)
gitpush2:
ifeq ($(RPS_GIT_ORIGIN), )
git remote add origin https://github.com/RefPerSys/RefPerSys.git
echo "Added GitHub repository as remote, run make gitpush2 again..."
else
git push $(RPS_GIT_ORIGIN) master
endif
ifeq ($(RPS_GIT_MIRROR), )
git remote add mirror https://gitlab.com/bstarynk/refpersys.git
echo "Added GitLab repository as remote, run make gitpush2 again..."
else
git push $(RPS_GIT_MIRROR) master
endif
$(SYNC)
load_rps.o: load_rps.cc refpersys.hh \
generated/rps-constants.hh generated/rps-names.hh generated/rps-roots.hh |GNUmakefile _config-refpersys.mk
echo dollar-less-F is $(<F)
echo basename-dollar-less-F is $(basename $(<F))
echo pkglist-refpersys is $(PKGLIST_refpersys)
echo pkglist-$(basename $(<F)) is $(PKGLIST_$(basename $(<F)))
$(REFPERSYS_CXX) $(REFPERSYS_PREPRO_FLAGS) $(REFPERSYS_COMPILER_FLAGS) \
-MD -MFMake-dependencies/__$(basename $(@F)).mkdep \
$(shell pkg-config --cflags $(PKGLIST_refpersys)) \
$(shell pkg-config --cflags $(PKGLIST_$(basename $(<F)))) \
-DRPS_THIS_SOURCE=\"$<\" -DRPS_GITID=\"$(RPS_GIT_ID)\" \
-DRPS_SHORTGITID=\"$(RPS_SHORTGIT_ID)\" \ \
-DRPS_HOST=\"$(RPS_HOST)\" \
-DRPS_BASENAME=\"$(notdir $(basename $(<F)))\" \
-DRPS_ARCH=\"$(RPS_ARCH)\" -DRPS_HAS_ARCH_$(RPS_ARCH) \
-DRPS_OPERSYS=\"$(RPS_OPERSYS)\" -DRPS_HAS_OPERSYS_$(RPS_OPERSYS) \
-c -o $@ $<
$(SYNC)
#- _gramrepl_rps.cc : gramrepl_rps.yy |GNUmakefile
#- $(RPS_BISON) --verbose --debug --language=c++ --file-prefix=_ \
#- --report=all --report-file=_gramrepl_rps.txt \
#- --html=_gramrepl_rps.html \
#- --header=_gramrepl_rps.hh \
#- --output=$@ $^ --no-lines
#-
%_rps.o: %_rps.cc refpersys.hh | GNUmakefile _config-refpersys.mk
echo dollar-less-F is $(<F)
echo at-F is $(@F)
echo basename-dollar-less-F is $(basename $(<F))
echo pkglist-refpersys is $(PKGLIST_refpersys)
echo pkglist-$(basename $(<F)) is $(PKGLIST_$(basename $(<F)))
$(REFPERSYS_CXX) $(REFPERSYS_PREPRO_FLAGS) $(REFPERSYS_COMPILER_FLAGS) \
-MD -MFMake-dependencies/__$(basename $(@F)).mkdep \
$(shell pkg-config --cflags $(PKGLIST_refpersys)) \
$(shell pkg-config --cflags $(PKGLIST_$(basename $(<F)))) \
-DRPS_THIS_SOURCE=\"$<\" -DRPS_GITID=\"$(RPS_GIT_ID)\" \
-DRPS_SHORTGITID=\"$(RPS_SHORTGIT_ID)\" \
-DRPS_BASENAME=\"$(notdir $(basename $(<F)))\" \
-DRPS_HOST=\"$(RPS_HOST)\" \
-DRPS_ARCH=\"$(RPS_ARCH)\" -DRPS_HAS_ARCH_$(RPS_ARCH) \
-DRPS_OPERSYS=\"$(RPS_OPERSYS)\" -DRPS_HAS_OPERSYS_$(RPS_OPERSYS) \
-c -o $@ $<
$(SYNC)
%_rps.ii: %_rps.cc refpersys.hh $(wildcard generated/rps*.hh) | GNUmakefile _config-refpersys.mk
echo dollar-less-F is $(<F)
echo basename-dollar-less-F is $(basename $(<F))
echo pkglist-refpersys is $(PKGLIST_refpersys)
echo pkglist-$(basename $(<F)) is $(PKGLIST_$(basename $(<F)))
$(REFPERSYS_CXX) -C -E $(REFPERSYS_PREPRO_FLAGS) $(REFPERSYS_COMPILER_FLAGS) \
-MD -MFMake-dependencies/__$(basename $(@F)).ii.mkdep \
$(shell pkg-config --cflags $(PKGLIST_refpersys)) \
$(shell pkg-config --cflags $(PKGLIST_$(basename $(<F)))) \
-DRPS_THIS_SOURCE=\"$<\" -DRPS_GITID=\"$(RPS_GIT_ID)\" \
-DRPS_SHORTGITID=\"$(RPS_SHORTGIT_ID)\" \
-DRPS_BASENAME=\"$(notdir $(basename $(<F)))\" \
-DRPS_HOST=\"$(RPS_HOST)\" \
-DRPS_ARCH=\"$(RPS_ARCH)\" -DRPS_HAS_ARCH_$(RPS_ARCH) \
-DRPS_OPERSYS=\"$(RPS_OPERSYS)\" -DRPS_HAS_OPERSYS_$(RPS_OPERSYS) \
$< | /bin/sed 's:^#://#:g' | $(ASTYLE) $(ASTYLEFLAGS) > $@
fltk_rps.o: fltk_rps.cc refpersys.hh $(wildcard generated/rps*.hh) | GNUmakefile _config-refpersys.mk
echo dollar-less-F is $(<F)
echo basename-dollar-less-F is $(basename $(<F))
echo pkglist-refpersys is $(PKGLIST_refpersys)
echo pkglist-$(basename $(<F)) is $(PKGLIST_$(basename $(<F)))
$(REFPERSYS_CXX) $(REFPERSYS_PREPRO_FLAGS) \
$(REFPERSYS_COMPILER_FLAGS) \
-MD -MFMake-dependencies/__$(basename $(@F)).mkdep \
$(shell pkg-config --cflags $(PKGLIST_refpersys)) \
$(shell pkg-config --cflags $(PKGLIST_$(basename $(<F)))) \
-DRPS_THIS_SOURCE=\"$<\" -DRPS_GITID=\"$(RPS_GIT_ID)\" \
-DRPS_SHORTGITID=\"$(RPS_SHORTGIT_ID)\" \
-DRPS_HOST=\"$(RPS_HOST)\" \
-DRPS_BASENAME=\"$(notdir $(basename $(<F)))\" \
-DRPS_ARCH=\"$(RPS_ARCH)\" -DRPS_HAS_ARCH_$(RPS_ARCH) \
-DRPS_OPERSYS=\"$(RPS_OPERSYS)\" -DRPS_HAS_OPERSYS_$(RPS_OPERSYS) \
$(shell $(REFPERSYS_FLTKCONFIG) -g --cflags) \
-c -o $@ $<
$(SYNC)
fltk_rps.ii: fltk_rps.cc refpersys.hh $(wildcard generated/rps*.hh) | GNUmakefile _config-refpersys.mk
echo dollar-less-F is $(<F)
echo basename-dollar-less-F is $(basename $(<F))
echo pkglist-refpersys is $(PKGLIST_refpersys)
echo pkglist-$(basename $(<F)) is $(PKGLIST_$(basename $(<F)))
$(REFPERSYS_CXX) -C -E $(REFPERSYS_PREPRO_FLAGS) \
$(REFPERSYS_COMPILER_FLAGS) \
-MD -MFMake-dependencies/__$(basename $(@F)).ii.mkdep \
$(shell pkg-config --cflags $(PKGLIST_refpersys)) \
$(shell pkg-config --cflags $(PKGLIST_$(basename $(<F)))) \
-DRPS_THIS_SOURCE=\"$<\" -DRPS_GITID=\"$(RPS_GIT_ID)\" \
-DRPS_SHORTGITID=\"$(RPS_SHORTGIT_ID)\" \
-DRPS_HOST=\"$(RPS_HOST)\" \
-DRPS_BASENAME=\"$(notdir $(basename $(<F)))\" \
-DRPS_ARCH=\"$(RPS_ARCH)\" -DRPS_HAS_ARCH_$(RPS_ARCH) \
-DRPS_OPERSYS=\"$(RPS_OPERSYS)\" -DRPS_HAS_OPERSYS_$(RPS_OPERSYS) \
$(shell $(REFPERSYS_FLTKCONFIG) -g --cflags) \
$< | /bin/sed 's:^#://#:g'| $(ASTYLE) $(ASTYLEFLAGS) > $@
%.ii.o: %.ii | GNUmakefile _config-refpersys.mk
echo dollar-less-F is $(<F)
echo basename-dollar-less-F is $(basename $(<F))
echo pkglist-refpersys is $(PKGLIST_refpersys)
echo pkglist-$(basename $(<F)) is $(PKGLIST_$(basename $(<F)))
$(REFPERSYS_CXX) -c -std=gnu++17 -g -O $< -o $@
## for plugins, see do-build-refpersys-plugin.cc
print-plugin-settings:
@printf "RPSPLUGIN_CXX='%s'\n" "$(REFPERSYS_CXX)"
@printf "RPSPLUGIN_CXXFLAGS='%s'\n" "$(REFPERSYS_PREPRO_FLAGS) $(REFPERSYS_COMPILER_FLAGS) $(shell pkg-config --cflags $(PKGLIST_refpersys))"
@printf "RPSPLUGIN_LDFLAGS='%s'\n" "-rdynamic -pthread -L /usr/local/lib -L /usr/lib $(LIBES)"
print-gmake-features:
@echo $(.FEATURES)
indent:
$(ASTYLE) $(ASTYLEFLAGS) tools/do-configure-refpersys.c
$(ASTYLE) $(ASTYLEFLAGS) do-scan-refpersys-pkgconfig.c
$(ASTYLE) $(ASTYLEFLAGS) refpersys.hh
$(ASTYLE) $(ASTYLEFLAGS) oid_rps.hh
$(ASTYLE) $(ASTYLEFLAGS) inline_rps.hh
for f in $(REFPERSYS_HUMAN_CPP_SOURCES) ; do \
$(ASTYLE) $(ASTYLEFLAGS) $$f ; done
for p in $(patsubst %, plugins_dir/%.cc, $(REFPERSYS_DESIRED_PLUGIN_BASENAMES)) ; do \
$(ASTYLE) $(ASTYLEFLAGS) $$p ; done
$(ASTYLE) $(ASTYLEFLAGS) tools/do-configure-refpersys.c
## redump target
redump: refpersys
./refpersys --dump=. --batch --run-name=$@
@if git diff -U1|grep '^[+-] ' | grep -v 'origitid|//: gen' ; then \
printf "make redump changed in %s git %s\n" $$(pwd) $(RPS_SHORTGIT_ID); \
git diff ; \
else \
git checkout rps_manifest.json ; \
printf "make redump reached fixpoint in %s git %s\n" $$(pwd) $(RPS_SHORTGIT_ID) ; \
fi
$(SYNC)
## alternate redump target
altredump: ./refpersys
./refpersys --dump=$(RPS_ALTDUMPDIR_PREFIX)_$$$$ --batch --run-name=$@ 2>&1 | tee $(RPS_ALTDUMPDIR_PREFIX).$$$$.out
$(SYNC)
################################################################
#### simple tests; the --run-name should start with test and not use $@ because of showtests target
test00: refpersys
@printf '\f\n\n\n\n////test00 first *****\n'
./refpersys -AREPL --test-repl-lexer 'show help' -B --run-name=test00.1 || (echo test00.1 failed; exit 1)
@printf '\f\n\n\n\n////test00 second *****\n'
./refpersys -AREPL --test-repl-lexer 'show RefPerSys_system' -B --run-name=test00.2 || (echo test00.2 failed; exit 1)
@printf '\f\n\n\n////test00 third *****\n'
./refpersys -AREPL --test-repl-lexer '@show put' -B --run-name=test00.3 || (echo test00.3 failed; exit 1)
@printf '\f\n\n\n////test00 fourth *****\n'
./refpersys -AREPL --test-repl-lexer 'show (1 + 2)' -B --run-name=test00.4 || (echo test00.4 failed; exit 1)
@printf '\f\n\n\n////test00 help REPL command (fifth) ****\n'
./refpersys -AREPL -c help -B --run-name=test00.5 || (echo test00.5 failed; exit 1)
@printf '\n\n\n////test00 FINISHED¤\n\n'
test01: refpersys
@echo test01 testing simple show help with a lot of debug
./refpersys -AREPL,CMD -c 'show help' -B --run-name=test01 || (echo test01 failed; exit 1)
@printf '\n\n\n////test01 FINISHED¤\n'
test01a: refpersys
@echo test01a testing simple show class with a lot of debug
./refpersys -AREPL -c 'show class' -B --run-name=test01a || (echo test01a failed; exit 1)
@printf '\n\n\n////test01 FINISHED¤\n'
test01b: refpersys
./refpersys -AREPL,LOW_REPL -c 'show help' -B --run-name=test01b || (echo test01b failed; exit 1)
@printf '\n\n\n////test01b FINISHED¤\n'
test01c: refpersys
@printf '\n\n\n//+ test01c !parse_sum 1 + 2\n' || (echo test01c failed; exit 1)
./refpersys -AREPL,LOW_REPL -c '!parse_sum 1 + 2' -B --run-name=test01c
@printf '\n\n\n////test01c FINISHED¤\n'
test01d: refpersys
@printf '\n\n\n//+ test01d !parse_sum 1 + 2 + 3\n'
./refpersys -AREPL,LOW_REPL -c '!parse_sum 1 + 2 + 3' -B --run-name=test01d || (echo test01d failed; exit 1)
@printf '\n\n\n////test01d FINISHED¤\n'
test01e: refpersys
@printf '\n\n\n//+ test01e !parse_sum 1 + 2 * 3\n'
./refpersys -AREPL,LOW_REPL -c '!parse_sum 1 + 2 * 3' -B --run-name=test01e || (echo test01e failed; exit 1)
@printf '\n\n\n////test01e FINISHED¤\n'
### notice the space after the 3 below
test01f: refpersys
./refpersys -AREPL,LOW_REPL -c '!parse_primary 3 ' -B --run-name=test01f || (echo test01f failed; exit 1)
@printf '\n\n\n////test01f FINISHED¤\n'
test02: refpersys
./refpersys -AREPL -c 'show RefPerSys_system' -B --run-name=test02 || (echo test02 failed; exit 1)
@printf '\n\n\n////test02 FINISHED¤\n'
test03: refpersys
./refpersys -AREPL -c 'show 1 + 2' -B --run-name=test03 || (echo test03 failed; exit 1)
@printf '\n\n\n////test03 FINISHED¤\n'
## test03 no tty
test03nt: refpersys
./refpersys --no-terminal -AREPL -c 'show 1 + 2' -B --run-name=test03nt || (echo test03nt failed; exit 1)
@printf '\n\n\n////test03nt FINISHED¤\n'
test03bis: refpersys
./refpersys -AREPL -c 'show 1 + 2 + 3' -B --run-name=test03bis || (echo test03bis failed; exit 1)
@printf '\n\n\n////test03bis FINISHED¤\n'
test04: refpersys
./refpersys -AREPL -c 'show 1 * 2 + 3 * 4' -B --run-name=test04 || (echo test04 failed; exit 1)
@printf '\n\n\n////test04 FINISHED¤\n'
test05: refpersys
./refpersys -AREPL -c 'show (1 + 2) ' -B --run-name=test05 || (echo test05 failed; exit 1)
@printf '\n\n\n////test05 FINISHED¤\n'
test06: refpersys
./refpersys -AREPL -c 'show 1' -B --run-name=test06 || (echo test06 failed; exit 1)
@printf '\n\n\n////test06 FINISHED¤\n'
test07: refpersys
./refpersys -AREPL -B -c '!parse_term 1' --run-name=test07.1 || (echo test07.1 failed; exit 1)
./refpersys -AREPL -B -c '!parse_sum 1 + 2' --run-name=test07.2 || (echo test07.2 failed; exit 1)
@printf '\n\n\n////test07 FINISHED¤\n'
test07a: refpersys
./refpersys -AREPL -B -c '!parse_term 1' --run-name=$@ || (echo test07a failed; exit 1)
@printf '\n\n\n////test07a FINISHED¤\n'
test08: refpersys
@echo missing test08 ; exit 1
test09: refpersys
@echo missing test09 ; exit 1
test10: refpersys
./refpersys -AREPL --run-name=test10 --run-delay=6s || (echo test10 failed; exit 1)
@printf '\n\n\n////test10 FINISHED¤\n'
test-load: refpersys
./refpersys --batch --run-name=test-load || (echo test-load failed; exit 1)
@printf '\n\n\n////test-load FINISHED¤\n'
## testing the carburetta-based command
testcarb1: refpersys
@printf '%s git %s\n' $@ $(RPS_SHORTGIT_ID)
./refpersys -AREPL,CMD -c "@display help" -B --run-name=testcarb1 || (echo testcarb1 failed; exit 1)
testcarb2: refpersys
@printf '%s git %s\n' $@ $(RPS_SHORTGIT_ID)
./refpersys -AREPL,CMD -c "@display 1 + 2 * 3" -B --run-name=testcarb2 || (echo testcarb2 failed; exit 1)
testcarb3: refpersys
@printf '%s git %s\n' $@ $(RPS_SHORTGIT_ID)
./refpersys -AREPL,CMD -c "@display 1 + 2" -B --run-name=testcarb3 || (echo testcarb3 failed; exit 1)
## testing the FLTK graphical interface
testfltk1: refpersys
@printf '%s git %s\n' $@ $(RPS_SHORTGIT_ID)
./refpersys -AREPL --run-name=$@ --run-delay=29s \
--fltk=$$HOME/fltk1-refpersys-pref \
--pid-file=$(RPS_HOMETMP)/refpersys.pid || (echo testfltk1 failed; exit 1)
@printf '\n\n\n////testfltk1 FINISHED git %s¤\n' $(RPS_SHORTGIT_ID)
testfltk2: refpersys
@printf '%s git %s\n' $@ $(RPS_SHORTGIT_ID)
./refpersys -dPROGARG -AREPL --run-delay=14s --fltk -bg ivory \
--run-name=$@ --pid-file=$(RPS_HOMETMP)/refpersys.pid || (echo testfltk2 failed; exit 1)
@printf '\n\n\n////testfltk2 FINISHED git %s¤\n' $(RPS_SHORTGIT_ID)
testfltk3: refpersys
@printf '%s git %s\n' $@ $(RPS_SHORTGIT_ID)
./refpersys -dPROGARG -AREPL --run-name=$@ --run-delay=29s --fltk -bg lightpink \
--pid-file=$(RPS_HOMETMP)/refpersys.pid || (echo testfltk3 failed; exit 1)
@printf '\n\n\n////testfltk3 FINISHED git %s¤\n' $(RPS_SHORTGIT_ID)
testfltk4: refpersys
@printf '%s git %s\n' $@ $(RPS_SHORTGIT_ID)
./refpersys -dPROGARG -AREPL --run-name=$@ --run-delay=15m --fltk -bg peachpuff \
--echo="hello from $@" || (echo testfltk4 failed; exit 1)
@printf '\n\n\n////testfltk4 FINISHED git %s¤\n' $(RPS_SHORTGIT_ID)
########### show the testing commands
showtests:
@printf '\nRefPerSys has %d testing commands\n' $(shell /bin/grep 'run-name=test' GNUmakefile | /bin/grep -v '@' | /bin/wc -l)
@/bin/grep 'run-name=test' GNUmakefile | /bin/grep -v '@' | /bin/tr -d '\t'
@printf 'showtests¤ done git %s in %s\n\n' $(RPS_SHORTGIT_ID) $(shell /bin/pwd)
## eof GNUmakefile