-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
1389 lines (1242 loc) · 55.6 KB
/
makefile
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
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#
# This GNU make makefile has been tested on:
# Linux (x86 & Sparc & PPC)
# OS X
# Solaris (x86 & Sparc) (gcc and Sun C)
# OpenBSD
# NetBSD
# FreeBSD
# HP-UX
# AIX
# Windows (MinGW & cygwin)
# Linux x86 targeting Android (using agcc script)
#
# Android targeted builds should invoke GNU make with GCC=agcc on
# the command line.
#
# In general, the logic below will detect and build with the available
# features which the host build environment provides.
#
# Dynamic loading of libpcap is the preferred default behavior if pcap.h
# is available at build time. Support to statically linking against libpcap
# is deprecated and may be removed in the future. Static linking against
# libpcap can be enabled if GNU make is invoked with USE_NETWORK=1 on the
# command line.
#
# Some platforms may not have vendor supplied libpcap available. HP-UX is
# one such example. The packages which are available for this platform
# install include files and libraries in user specified directories. In
# order for this makefile to locate where these components may have been
# installed, gmake should be invoked with LPATH=/usr/lib:/usr/local/lib
# defined (adjusted as needed depending on where they may be installed).
#
# The default build will build compiler optimized binaries.
# If debugging is desired, then GNU make can be invoked with
# DEBUG=1 on the command line.
#
# OSX and other environments may have the LLVM (clang) compiler
# installed. If you want to build with the clang compiler, invoke
# make with GCC=clang.
#
# Internal ROM support can be disabled if GNU make is invoked with
# DONT_USE_ROMS=1 on the command line.
#
# Asynchronous I/O support can be disabled if GNU make is invoked with
# NOASYNCH=1 on the command line.
#
# For linting (or other code analyzers) make may be invoked similar to:
#
# make GCC=cppcheck CC_OUTSPEC= LDFLAGS= CFLAGS_G="--enable=all --template=gcc" CC_STD=--std=c99
#
# CC Command (and platform available options). (Poor man's autoconf)
#
ifeq (old,$(shell gmake --version /dev/null 2>&1 | grep 'GNU Make' | awk '{ if ($$3 < "3.81") {print "old"} }'))
GMAKE_VERSION = $(shell gmake --version /dev/null 2>&1 | grep 'GNU Make' | awk '{ print $$3 }')
$(warning *** Warning *** GNU Make Version $(GMAKE_VERSION) is too old to)
$(warning *** Warning *** fully process this makefile)
endif
# building the pdp11, or any vax simulator could use networking support
BUILD_SINGLE := $(MAKECMDGOALS) $(BLANK_SUFFIX)
ifneq (,$(or $(findstring pdp11,$(MAKECMDGOALS)),$(findstring vax,$(MAKECMDGOALS)),$(findstring all,$(MAKECMDGOALS))))
NETWORK_USEFUL = true
ifneq (,$(or $(findstring microvax1,$(MAKECMDGOALS)),$(findstring microvax2,$(MAKECMDGOALS))))
VIDEO_USEFUL = true
endif
ifneq (,$(findstring all,$(MAKECMDGOALS))$(word 2,$(MAKECMDGOALS)))
BUILD_MULTIPLE = s
VIDEO_USEFUL = true
endif
else
ifeq ($(MAKECMDGOALS),)
# default target is all
NETWORK_USEFUL = true
VIDEO_USEFUL = true
BUILD_MULTIPLE = s
BUILD_SINGLE := all $(BUILD_SINGLE)
endif
endif
ifeq ($(WIN32),) #*nix Environments (&& cygwin)
ifeq ($(GCC),)
ifeq (,$(shell which gcc 2>/dev/null))
$(info *** Warning *** Using local cc since gcc isn't available locally.)
$(info *** Warning *** You may need to install gcc to build working simulators.)
GCC = cc
else
GCC = gcc
endif
endif
OSTYPE = $(shell uname)
# OSNAME is used in messages to indicate the source of libpcap components
OSNAME = $(OSTYPE)
ifeq (SunOS,$(OSTYPE))
TEST = /bin/test
else
TEST = test
endif
ifeq (CYGWIN,$(findstring CYGWIN,$(OSTYPE))) # uname returns CYGWIN_NT-n.n-ver
OSTYPE = cygwin
OSNAME = windows-build
endif
ifeq (,$(shell $(GCC) -v /dev/null 2>&1 | grep 'clang'))
GCC_VERSION = $(shell $(GCC) -v /dev/null 2>&1 | grep 'gcc version' | awk '{ print $$3 }')
COMPILER_NAME = GCC Version: $(GCC_VERSION)
ifeq (,$(GCC_VERSION))
ifeq (SunOS,$(OSTYPE))
ifneq (,$(shell $(GCC) -V 2>&1 | grep 'Sun C'))
SUNC_VERSION = $(shell $(GCC) -V 2>&1 | grep 'Sun C')
COMPILER_NAME = $(wordlist 2,10,$(SUNC_VERSION))
endif
endif
ifeq (HP-UX,$(OSTYPE))
ifneq (,$(shell what `which $(firstword $(GCC)) 2>&1`| grep -i compiler))
COMPILER_NAME = $(strip $(shell what `which $(firstword $(GCC)) 2>&1` | grep -i compiler))
endif
endif
endif
else
ifeq (Apple,$(shell $(GCC) -v /dev/null 2>&1 | grep 'Apple' | awk '{ print $$1 }'))
COMPILER_NAME = $(shell $(GCC) -v /dev/null 2>&1 | grep 'Apple' | awk '{ print $$1 " " $$2 " " $$3 " " $$4 }')
CLANG_VERSION = $(word 4,$(COMPILER_NAME))
else
COMPILER_NAME = $(shell $(GCC) -v /dev/null 2>&1 | grep 'clang version' | awk '{ print $$1 " " $$2 " " $$3 }')
CLANG_VERSION = $(word 3,$(COMPILER_NAME))
ifeq (,$(findstring .,$(CLANG_VERSION)))
COMPILER_NAME = $(shell $(GCC) -v /dev/null 2>&1 | grep 'clang version' | awk '{ print $$1 " " $$2 " " $$3 " " $$4 }')
CLANG_VERSION = $(word 4,$(COMPILER_NAME))
endif
endif
endif
ifeq (git-repo,$(shell if $(TEST) -d ./.git; then echo git-repo; fi))
ifeq (need-hooks,$(shell if $(TEST) ! -e ./.git/hooks/post-checkout; then echo need-hooks; fi))
$(info *** Installing git hooks in local repository ***)
GIT_HOOKS += $(shell /bin/cp './Visual Studio Projects/git-hooks/post-commit' ./.git/hooks/)
GIT_HOOKS += $(shell /bin/cp './Visual Studio Projects/git-hooks/post-checkout' ./.git/hooks/)
GIT_HOOKS += $(shell /bin/cp './Visual Studio Projects/git-hooks/post-merge' ./.git/hooks/)
GIT_HOOKS += $(shell ./.git/hooks/post-checkout)
ifneq (,$(strip $(GIT_HOOKS)))
$(info *** Warning - Error installing git hooks *** $(GIT_HOOKS))
endif
endif
endif
LTO_EXCLUDE_VERSIONS =
PCAPLIB = pcap
ifeq (agcc,$(findstring agcc,$(GCC))) # Android target build?
OS_CCDEFS = -D_GNU_SOURCE
ifeq (,$(NOASYNCH))
OS_CCDEFS += -DSIM_ASYNCH_IO
endif
OS_LDFLAGS = -lm
else # Non-Android Builds
INCPATH:=/usr/include
LIBPATH:=/usr/lib
OS_CCDEFS = -D_GNU_SOURCE
GCC_OPTIMIZERS_CMD = $(GCC) -v --help 2>&1
GCC_WARNINGS_CMD = $(GCC) -v --help 2>&1
LD_ELF = $(shell echo | $(GCC) -E -dM - | grep __ELF__)
ifeq (Darwin,$(OSTYPE))
OSNAME = OSX
LIBEXT = dylib
INCPATH:=$(shell $(GCC) -x c -v -E /dev/null 2>&1 | grep -A 10 '> search starts here' | grep '^ ' | grep -v 'framework directory' | tr -d '\n')
ifeq (incopt,$(shell if $(TEST) -d /opt/local/include; then echo incopt; fi))
INCPATH += /opt/local/include
OS_CCDEFS += -I/opt/local/include
endif
ifeq (libopt,$(shell if $(TEST) -d /opt/local/lib; then echo libopt; fi))
LIBPATH += /opt/local/lib
OS_LDFLAGS += -L/opt/local/lib
endif
ifeq (libXt,$(shell if $(TEST) -d /usr/X11/lib; then echo libXt; fi))
LIBPATH += /usr/X11/lib
OS_LDFLAGS += -L/usr/X11/lib
endif
else
ifeq (Linux,$(OSTYPE))
LIBPATH := $(sort $(foreach lib,$(shell /sbin/ldconfig -p | grep ' => /' | sed 's/^.* => //'),$(dir $(lib))))
LIBEXT = so
else
ifeq (SunOS,$(OSTYPE))
OSNAME = Solaris
LIBPATH := $(shell crle | grep 'Default Library Path' | awk '{ print $$5 }' | sed 's/:/ /g')
LIBEXT = so
OS_LDFLAGS += -lsocket -lnsl
ifeq (incsfw,$(shell if $(TEST) -d /opt/sfw/include; then echo incsfw; fi))
INCPATH += /opt/sfw/include
OS_CCDEFS += -I/opt/sfw/include
endif
ifeq (libsfw,$(shell if $(TEST) -d /opt/sfw/lib; then echo libsfw; fi))
LIBPATH += /opt/sfw/lib
OS_LDFLAGS += -L/opt/sfw/lib -R/opt/sfw/lib
endif
OS_CCDEFS += -D_LARGEFILE_SOURCE
else
ifeq (cygwin,$(OSTYPE))
# use 0readme_ethernet.txt documented Windows pcap build components
INCPATH += ../windows-build/winpcap/WpdPack/include
LIBPATH += ../windows-build/winpcap/WpdPack/lib
PCAPLIB = wpcap
LIBEXT = a
else
ifneq (,$(findstring AIX,$(OSTYPE)))
OS_LDFLAGS += -lm -lrt
ifeq (incopt,$(shell if $(TEST) -d /opt/freeware/include; then echo incopt; fi))
INCPATH += /opt/freeware/include
OS_CCDEFS += -I/opt/freeware/include
endif
ifeq (libopt,$(shell if $(TEST) -d /opt/freeware/lib; then echo libopt; fi))
LIBPATH += /opt/freeware/lib
OS_LDFLAGS += -L/opt/freeware/lib
endif
else
ifeq (,$(findstring NetBSD,$(OSTYPE)))
ifneq (no ldconfig,$(findstring no ldconfig,$(shell which ldconfig 2>&1)))
LDSEARCH :=$(shell ldconfig -r | grep 'search directories' | awk '{print $$3}' | sed 's/:/ /g')
endif
ifneq (,$(LDSEARCH))
LIBPATH := $(LDSEARCH)
else
ifeq (,$(strip $(LPATH)))
$(info *** Warning ***)
$(info *** Warning *** The library search path on your $(OSTYPE) platform can't be)
$(info *** Warning *** determined. This should be resolved before you can expect)
$(info *** Warning *** to have fully working simulators.)
$(info *** Warning ***)
$(info *** Warning *** You can specify your library paths via the LPATH environment)
$(info *** Warning *** variable.)
$(info *** Warning ***)
else
LIBPATH = $(subst :, ,$(LPATH))
OS_LDFLAGS += $(patsubst %,-L%,$(LIBPATH))
endif
endif
endif
endif
ifeq (usrpkglib,$(shell if $(TEST) -d /usr/pkg/lib; then echo usrpkglib; fi))
LIBPATH += /usr/pkg/lib
INCPATH += /usr/pkg/include
OS_LDFLAGS += -L/usr/pkg/lib -R/usr/pkg/lib
endif
ifeq (/usr/local/lib,$(findstring /usr/local/lib,$(LIBPATH)))
INCPATH += /usr/local/include
OS_CCDEFS += -I/usr/local/include
endif
ifneq (,$(findstring NetBSD,$(OSTYPE))$(findstring FreeBSD,$(OSTYPE))$(findstring AIX,$(OSTYPE)))
LIBEXT = so
else
ifeq (HP-UX,$(OSTYPE))
ifeq (ia64,$(shell uname -m))
LIBEXT = so
else
LIBEXT = sl
endif
OS_CCDEFS += -D_HPUX_SOURCE -D_LARGEFILE64_SOURCE
OS_LDFLAGS += -Wl,+b:
NO_LTO = 1
else
LIBEXT = a
endif
endif
endif
endif
endif
endif
# Some gcc versions don't support LTO, so only use LTO when the compiler is known to support it
ifeq (,$(NO_LTO))
ifneq (,$(GCC_VERSION))
ifeq (,$(shell $(GCC) -v /dev/null 2>&1 | grep '\-\-enable-lto'))
LTO_EXCLUDE_VERSIONS += $(GCC_VERSION)
endif
endif
endif
endif
$(info lib paths are: $(LIBPATH))
$(info include paths are: $(INCPATH))
find_lib = $(strip $(firstword $(foreach dir,$(strip $(LIBPATH)),$(wildcard $(dir)/lib$(1).$(LIBEXT)))))
find_include = $(strip $(firstword $(foreach dir,$(strip $(INCPATH)),$(wildcard $(dir)/$(1).h))))
ifneq (,$(call find_lib,m))
OS_LDFLAGS += -lm
$(info using libm: $(call find_lib,m))
endif
ifneq (,$(call find_lib,rt))
OS_LDFLAGS += -lrt
$(info using librt: $(call find_lib,rt))
endif
ifneq (,$(call find_include,pthread))
ifneq (,$(call find_lib,pthread))
OS_CCDEFS += -DUSE_READER_THREAD
ifeq (,$(NOASYNCH))
OS_CCDEFS += -DSIM_ASYNCH_IO
endif
OS_LDFLAGS += -lpthread
$(info using libpthread: $(call find_lib,pthread) $(call find_include,pthread))
else
LIBEXTSAVE := $(LIBEXT)
LIBEXT = a
ifneq (,$(call find_lib,pthread))
OS_CCDEFS += -DUSE_READER_THREAD
ifeq (,$(NOASYNCH))
OS_CCDEFS += -DSIM_ASYNCH_IO
endif
OS_LDFLAGS += -lpthread
$(info using libpthread: $(call find_lib,pthread) $(call find_include,pthread))
endif
LIBEXT = $(LIBEXTSAVE)
endif
endif
ifneq (,$(call find_include,dlfcn))
ifneq (,$(call find_lib,dl))
OS_CCDEFS += -DHAVE_DLOPEN=$(LIBEXT)
OS_LDFLAGS += -ldl
$(info using libdl: $(call find_lib,dl) $(call find_include,dlfcn))
else
ifneq (,$(findstring BSD,$(OSTYPE))$(findstring AIX,$(OSTYPE)))
OS_CCDEFS += -DHAVE_DLOPEN=so
$(info using libdl: $(call find_include,dlfcn))
else
ifneq (,$(call find_lib,dld))
OS_CCDEFS += -DHAVE_DLOPEN=$(LIBEXT)
OS_LDFLAGS += -ldld
$(info using libdld: $(call find_lib,dld) $(call find_include,dlfcn))
endif
endif
endif
endif
ifneq (,$(call find_include,glob))
OS_CCDEFS += -DHAVE_GLOB
else
ifneq (,$(call find_include,fnmatch))
OS_CCDEFS += -DHAVE_FNMATCH
endif
endif
ifneq (,$(VIDEO_USEFUL))
ifneq (,$(call find_include,SDL2/SDL))
ifneq (,$(call find_lib,SDL2))
OS_CCDEFS += -DHAVE_LIBSDL -I$(dir $(call find_include,SDL2/SDL))
OS_LDFLAGS += -lSDL2
VIDEO_FEATURES = - video capabilities provided by libSDL2 (Simple Directmedia Layer)
$(info using libSDL2: $(call find_lib,SDL2) $(call find_include,SDL2/SDL))
ifeq (Darwin,$(OSTYPE))
OS_LDFLAGS += -lobjc -framework cocoa
endif
endif
else
ifneq (,$(call find_include,SDL/SDL))
ifneq (,$(call find_lib,SDL))
OS_CCDEFS += -DHAVE_LIBSDL -I$(dir $(call find_include,SDL/SDL))
OS_LDFLAGS += -lSDL
VIDEO_FEATURES = - video capabilities provided by libSDL (Simple Directmedia Layer)
$(info using libSDL: $(call find_lib,SDL) $(call find_include,SDL/SDL))
ifeq (Darwin,$(OSTYPE))
OS_LDFLAGS += -lobjc -framework cocoa
endif
endif
endif
endif
ifeq (,$(findstring HAVE_LIBSDL,$(OS_CCDEFS)))
$(info *** Warning ***)
$(info *** Warning *** The simulator$(BUILD_MULTIPLE) you are building could provide more)
$(info *** Warning *** functionality if video support were available on your system.)
$(info *** Warning *** Install the development components of libSDL packaged by your)
$(info *** Warning *** operating system distribution and rebuild your simulator to)
$(info *** Warning *** enable this extra functionality.)
$(info *** Warning ***)
endif
endif
ifneq (,$(NETWORK_USEFUL))
ifneq (,$(call find_include,pcap))
ifneq (,$(shell grep 'pcap/pcap.h' $(call find_include,pcap) | grep include))
PCAP_H_PATH = $(dir $(call find_include,pcap))pcap/pcap.h
else
PCAP_H_PATH = $(call find_include,pcap)
endif
ifneq (,$(shell grep pcap_compile $(PCAP_H_PATH) | grep const))
BPF_CONST_STRING = -DBPF_CONST_STRING
endif
NETWORK_CCDEFS += -DHAVE_PCAP_NETWORK -I$(dir $(call find_include,pcap)) $(BPF_CONST_STRING)
NETWORK_LAN_FEATURES += PCAP
ifneq (,$(call find_lib,$(PCAPLIB)))
ifneq ($(USE_NETWORK),) # Network support specified on the GNU make command line
NETWORK_CCDEFS += -DUSE_NETWORK
$(info *** Warning ***)
$(info *** Warning *** Statically linking against libpcap is provides no measurable)
$(info *** Warning *** benefits over dynamically linking libpcap.)
$(info *** Warning ***)
$(info *** Warning *** Support for linking this way is currently deprecated and may be removed)
$(info *** Warning *** in the future.)
$(info *** Warning ***)
ifeq (cygwin,$(OSTYPE))
# cygwin has no ldconfig so explicitly specify pcap object library
NETWORK_LDFLAGS = -L$(dir $(call find_lib,$(PCAPLIB))) -Wl,-R,$(dir $(call find_lib,$(PCAPLIB))) -l$(PCAPLIB)
else
NETWORK_LDFLAGS = -l$(PCAPLIB)
endif
$(info using libpcap: $(call find_lib,$(PCAPLIB)) $(call find_include,pcap))
NETWORK_FEATURES = - static networking support using $(OSNAME) provided libpcap components
else # default build uses dynamic libpcap
NETWORK_CCDEFS += -DUSE_SHARED
$(info using libpcap: $(call find_include,pcap))
NETWORK_FEATURES = - dynamic networking support using $(OSNAME) provided libpcap components
endif
else
LIBEXTSAVE := $(LIBEXT)
LIBEXT = a
ifneq (,$(call find_lib,$(PCAPLIB)))
NETWORK_CCDEFS += -DUSE_NETWORK
NETWORK_LDFLAGS := -L$(dir $(call find_lib,$(PCAPLIB))) -l$(PCAPLIB)
NETWORK_FEATURES = - static networking support using $(OSNAME) provided libpcap components
$(info using libpcap: $(call find_lib,$(PCAPLIB)) $(call find_include,pcap))
endif
LIBEXT = $(LIBEXTSAVE)
endif
else
# On non-Linux platforms, we'll still try to provide deprecated support for libpcap in /usr/local
INCPATHSAVE := $(INCPATH)
ifeq (,$(findstring Linux,$(OSTYPE)))
# Look for package built from tcpdump.org sources with default install target (or cygwin winpcap)
INCPATH += /usr/local/include
PCAP_H_FOUND = $(call find_include,pcap)
endif
ifneq (,$(strip $(PCAP_H_FOUND)))
ifneq (,$(shell grep 'pcap/pcap.h' $(call find_include,pcap) | grep include))
PCAP_H_PATH = $(dir $(call find_include,pcap))pcap/pcap.h
else
PCAP_H_PATH = $(call find_include,pcap)
endif
ifneq (,$(shell grep pcap_compile $(PCAP_H_PATH) | grep const))
BPF_CONST_STRING = -DBPF_CONST_STRING
endif
LIBEXTSAVE := $(LIBEXT)
# first check if binary - shared objects are available/installed in the linker known search paths
ifneq (,$(call find_lib,$(PCAPLIB)))
NETWORK_CCDEFS = -DUSE_SHARED -I$(dir $(call find_include,pcap)) $(BPF_CONST_STRING)
NETWORK_FEATURES = - dynamic networking support using libpcap components from www.tcpdump.org and locally installed libpcap.$(LIBEXT)
$(info using libpcap: $(call find_include,pcap))
else
LIBPATH += /usr/local/lib
LIBEXT = a
ifneq (,$(call find_lib,$(PCAPLIB)))
$(info using libpcap: $(call find_lib,$(PCAPLIB)) $(call find_include,pcap))
ifeq (cygwin,$(OSTYPE))
NETWORK_CCDEFS = -DUSE_NETWORK -DHAVE_PCAP_NETWORK -I$(dir $(call find_include,pcap)) $(BPF_CONST_STRING)
NETWORK_LDFLAGS = -L$(dir $(call find_lib,$(PCAPLIB))) -Wl,-R,$(dir $(call find_lib,$(PCAPLIB))) -l$(PCAPLIB)
NETWORK_FEATURES = - static networking support using libpcap components located in the cygwin directories
else
NETWORK_CCDEFS := -DUSE_NETWORK -DHAVE_PCAP_NETWORK -isystem -I$(dir $(call find_include,pcap)) $(BPF_CONST_STRING) $(call find_lib,$(PCAPLIB))
NETWORK_FEATURES = - networking support using libpcap components from www.tcpdump.org
$(info *** Warning ***)
$(info *** Warning *** $(BUILD_SINGLE)Simulator$(BUILD_MULTIPLE) being built with networking support using)
$(info *** Warning *** libpcap components from www.tcpdump.org.)
$(info *** Warning *** Some users have had problems using the www.tcpdump.org libpcap)
$(info *** Warning *** components for simh networking. For best results, with)
$(info *** Warning *** simh networking, it is recommended that you install the)
$(info *** Warning *** libpcap-dev (or libpcap-devel) package from your $(OSNAME) distribution)
$(info *** Warning ***)
$(info *** Warning *** Building with the components manually installed from www.tcpdump.org)
$(info *** Warning *** is officially deprecated. Attempting to do so is unsupported.)
$(info *** Warning ***)
endif
else
$(error using libpcap: $(call find_include,pcap) missing $(PCAPLIB).$(LIBEXT))
endif
NETWORK_LAN_FEATURES += PCAP
endif
LIBEXT = $(LIBEXTSAVE)
else
INCPATH = $(INCPATHSAVE)
$(info *** Warning ***)
$(info *** Warning *** $(BUILD_SINGLE)Simulator$(BUILD_MULTIPLE) are being built WITHOUT)
$(info *** Warning *** libpcap networking support)
$(info *** Warning ***)
$(info *** Warning *** To build simulator(s) with libpcap networking support you)
$(info *** Warning *** should read 0readme_ethernet.txt and follow the instructions)
$(info *** Warning *** regarding the needed libpcap development components for your)
$(info *** Warning *** $(OSTYPE) platform)
$(info *** Warning ***)
endif
endif
# Consider other network connections
ifneq (,$(call find_lib,vdeplug))
# libvdeplug requires the use of the OS provided libpcap
ifeq (,$(findstring usr/local,$(NETWORK_CCDEFS)))
ifneq (,$(call find_include,libvdeplug))
# Provide support for vde networking
NETWORK_CCDEFS += -DHAVE_VDE_NETWORK
NETWORK_LAN_FEATURES += VDE
ifeq (,$(findstring USE_NETWORK,$(NETWORK_CCDEFS))$(findstring USE_SHARED,$(NETWORK_CCDEFS)))
NETWORK_CCDEFS += -DUSE_NETWORK
endif
ifeq (Darwin,$(OSTYPE))
NETWORK_LDFLAGS += -lvdeplug -L$(dir $(call find_lib,vdeplug))
else
NETWORK_LDFLAGS += -lvdeplug -Wl,-R,$(dir $(call find_lib,vdeplug)) -L$(dir $(call find_lib,vdeplug))
endif
$(info using libvdeplug: $(call find_lib,vdeplug) $(call find_include,libvdeplug))
endif
endif
endif
ifeq (,$(findstring HAVE_VDE_NETWORK,$(NETWORK_CCDEFS)))
# Support is available on Linux for libvdeplug. Advise on its usage
ifneq (,$(findstring Linux,$(OSTYPE)))
ifneq (,$(findstring USE_NETWORK,$(NETWORK_CCDEFS))$(findstring USE_SHARED,$(NETWORK_CCDEFS)))
$(info *** Warning ***)
$(info *** Warning *** $(BUILD_SINGLE)Simulator$(BUILD_MULTIPLE) are being built with)
$(info *** Warning *** minimal libpcap networking support)
$(info *** Warning ***)
endif
$(info *** Warning *** Simulators on your $(OSNAME) platform can also be built with)
$(info *** Warning *** extended LAN Ethernet networking support by using VDE Ethernet.)
$(info *** Warning ***)
$(info *** Warning *** To build simulator(s) with extended networking support you)
$(info *** Warning *** should read 0readme_ethernet.txt and follow the instructions)
$(info *** Warning *** regarding the needed libvdeplug components for your $(OSNAME))
$(info *** Warning *** platform)
$(info *** Warning ***)
endif
endif
ifneq (,$(call find_include,linux/if_tun))
# Provide support for Tap networking on Linux
NETWORK_CCDEFS += -DHAVE_TAP_NETWORK
NETWORK_LAN_FEATURES += TAP
ifeq (,$(findstring USE_NETWORK,$(NETWORK_CCDEFS))$(findstring USE_SHARED,$(NETWORK_CCDEFS)))
NETWORK_CCDEFS += -DUSE_NETWORK
endif
endif
ifeq (bsdtuntap,$(shell if $(TEST) -e /usr/include/net/if_tun.h -o -e /Library/Extensions/tap.kext; then echo bsdtuntap; fi))
# Provide support for Tap networking on BSD platforms (including OS X)
NETWORK_CCDEFS += -DHAVE_TAP_NETWORK -DHAVE_BSDTUNTAP
NETWORK_LAN_FEATURES += TAP
ifeq (,$(findstring USE_NETWORK,$(NETWORK_CCDEFS))$(findstring USE_SHARED,$(NETWORK_CCDEFS)))
NETWORK_CCDEFS += -DUSE_NETWORK
endif
endif
ifeq (,$(findstring USE_NETWORK,$(NETWORK_CCDEFS))$(findstring USE_SHARED,$(NETWORK_CCDEFS))$(findstring HAVE_VDE_NETWORK,$(NETWORK_CCDEFS)))
NETWORK_CCDEFS += -DUSE_NETWORK
NETWORK_FEATURES = - WITHOUT Local LAN networking support
$(info *** Warning ***)
$(info *** Warning *** $(BUILD_SINGLE)Simulator$(BUILD_MULTIPLE) are being built WITHOUT LAN networking support)
$(info *** Warning ***)
$(info *** Warning *** To build simulator(s) with networking support you should read)
$(info *** Warning *** 0readme_ethernet.txt and follow the instructions regarding the)
$(info *** Warning *** needed libpcap components for your $(OSTYPE) platform)
$(info *** Warning ***)
endif
NETWORK_OPT = $(NETWORK_CCDEFS)
endif
ifneq (binexists,$(shell if $(TEST) -e BIN; then echo binexists; fi))
MKDIRBIN = mkdir -p BIN
endif
ifeq (commit-id-exists,$(shell if $(TEST) -e .git-commit-id; then echo commit-id-exists; fi))
GIT_COMMIT_ID=$(shell cat .git-commit-id)
else
ifeq (,$(shell grep 'define SIM_GIT_COMMIT_ID' sim_rev.h | grep 'Format:'))
GIT_COMMIT_ID=$(shell grep 'define SIM_GIT_COMMIT_ID' sim_rev.h | awk '{ print $$3 }')
endif
endif
else
#Win32 Environments (via MinGW32)
GCC = gcc
ifeq (XP,$(findstring XP,$(shell ver)))
GCC_Path := C:\MinGW\bin\
else
GCC_Path := $(dir $(shell where gcc.exe))
endif
ifeq (rename-build-support,$(shell if exist ..\windows-build-windows-build echo rename-build-support))
FIXED_BUILD := $(shell move ..\windows-build-windows-build ..\windows-build >NUL)
endif
GCC_VERSION = $(word 3,$(shell $(GCC) --version))
COMPILER_NAME = GCC Version: $(GCC_VERSION)
LTO_EXCLUDE_VERSIONS = 4.5.2
ifeq (pthreads,$(shell if exist ..\windows-build\pthreads\Pre-built.2\include\pthread.h echo pthreads))
PTHREADS_CCDEFS = -DUSE_READER_THREAD -DPTW32_STATIC_LIB -I../windows-build/pthreads/Pre-built.2/include
ifeq (,$(NOASYNCH))
PTHREADS_CCDEFS += -DSIM_ASYNCH_IO
endif
PTHREADS_LDFLAGS = -lpthreadGC2 -L..\windows-build\pthreads\Pre-built.2\lib
else
ifeq (pthreads,$(shell if exist $(dir $(GCC_Path))..\include\pthread.h echo pthreads))
PTHREADS_CCDEFS = -DUSE_READER_THREAD
ifeq (,$(NOASYNCH))
PTHREADS_CCDEFS += -DSIM_ASYNCH_IO
endif
PTHREADS_LDFLAGS = -lpthread
endif
endif
ifeq (pcap,$(shell if exist ..\windows-build\winpcap\Wpdpack\include\pcap.h echo pcap))
NETWORK_LDFLAGS =
NETWORK_OPT = -DUSE_SHARED -I../windows-build/winpcap/Wpdpack/include -I$(GCC_Path)..\include\ddk
NETWORK_FEATURES = - dynamic networking support using windows-build provided libpcap components
else
ifeq (pcap,$(shell if exist $(dir $(GCC_Path))..\include\pcap.h echo pcap))
NETWORK_LDFLAGS =
NETWORK_OPT = -DUSE_SHARED -I$(GCC_Path)..\include\ddk
NETWORK_FEATURES = - dynamic networking support using libpcap components found in the MinGW directories
endif
endif
ifneq (,$(VIDEO_USEFUL))
ifeq (libSDL,$(shell if exist ..\windows-build\libSDL\SDL2-2.0.0\include\SDL.h echo libSDL))
OS_CCDEFS += -DHAVE_LIBSDL -I..\windows-build\libSDL\SDL2-2.0.0\include
OS_LDFLAGS += -lSDL2 -L..\windows-build\libSDL\SDL2-2.0.0\lib
VIDEO_FEATURES = - video capabilities provided by libSDL2 (Simple Directmedia Layer)
else
$(info ***********************************************************************)
$(info ***********************************************************************)
$(info ** This build could produce simulators with video capabilities. **)
$(info ** However, the required files to achieve this can't be found on **)
$(info ** this system. Download the file: **)
$(info ** https://github.com/simh/windows-build/archive/windows-build.zip **)
$(info ** Refer to the file: **)
$(info ** "Visual Studio Projects\0ReadMe_Projects.txt" for where to place **)
$(info ** the 'windows-build' folder extracted from that zip file. **)
$(info ***********************************************************************)
$(info ***********************************************************************)
$(info .)
endif
endif
OS_CCDEFS += -fms-extensions $(PTHREADS_CCDEFS)
OS_LDFLAGS += -lm -lwsock32 -lwinmm $(PTHREADS_LDFLAGS)
EXE = .exe
ifneq (binexists,$(shell if exist BIN echo binexists))
MKDIRBIN = if not exist BIN mkdir BIN
endif
ifneq ($(USE_NETWORK),)
NETWORK_OPT += -DUSE_SHARED
endif
ifneq (,$(shell if exist .git-commit-id type .git-commit-id))
GIT_COMMIT_ID=$(shell if exist .git-commit-id type .git-commit-id)
else
ifeq (,$(shell findstr /C:"define SIM_GIT_COMMIT_ID" sim_rev.h | findstr Format))
GIT_COMMIT_ID=$(shell for /F "tokens=3" %%i in ("$(shell findstr /C:"define SIM_GIT_COMMIT_ID" sim_rev.h)") do echo %%i)
endif
endif
ifneq (windows-build,$(shell if exist ..\windows-build\README.md echo windows-build))
$(info ***********************************************************************)
$(info ***********************************************************************)
$(info ** This build is operating without the required windows-build **)
$(info ** components and therefore will produce less than optimal **)
$(info ** simulator operation and features. **)
$(info ** Download the file: **)
$(info ** https://github.com/simh/windows-build/archive/windows-build.zip **)
$(info ** Refer to the file: **)
$(info ** "Visual Studio Projects\0ReadMe_Projects.txt" for where to place **)
$(info ** the 'windows-build' folder extracted from that zip file. **)
$(info ***********************************************************************)
$(info ***********************************************************************)
$(info .)
endif
endif # Win32 (via MinGW)
ifneq (,$(GIT_COMMIT_ID))
CFLAGS_GIT = -DSIM_GIT_COMMIT_ID=$(GIT_COMMIT_ID)
endif
ifneq ($(DEBUG),)
CFLAGS_G = -g -ggdb -g3
CFLAGS_O = -O0
BUILD_FEATURES = - debugging support
else
ifneq (clang,$(findstring clang,$(COMPILER_NAME)))
CFLAGS_O = -O2
else
ifeq (Darwin,$(OSTYPE))
CFLAGS_O += -O4 -fno-strict-overflow -flto -fwhole-program
else
CFLAGS_O := -O2 -fno-strict-overflow
endif
endif
LDFLAGS_O =
GCC_MAJOR_VERSION = $(firstword $(subst ., ,$(GCC_VERSION)))
ifneq (3,$(GCC_MAJOR_VERSION))
ifeq (,$(GCC_OPTIMIZERS_CMD))
GCC_OPTIMIZERS_CMD = $(GCC) --help=optimizers
endif
GCC_OPTIMIZERS = $(shell $(GCC_OPTIMIZERS_CMD))
endif
ifneq (,$(findstring $(GCC_VERSION),$(LTO_EXCLUDE_VERSIONS)))
NO_LTO = 1
endif
ifneq (,$(findstring -finline-functions,$(GCC_OPTIMIZERS)))
CFLAGS_O += -finline-functions
endif
ifneq (,$(findstring -fgcse-after-reload,$(GCC_OPTIMIZERS)))
CFLAGS_O += -fgcse-after-reload
endif
ifneq (,$(findstring -fpredictive-commoning,$(GCC_OPTIMIZERS)))
CFLAGS_O += -fpredictive-commoning
endif
ifneq (,$(findstring -fipa-cp-clone,$(GCC_OPTIMIZERS)))
CFLAGS_O += -fipa-cp-clone
endif
ifneq (,$(findstring -funsafe-loop-optimizations,$(GCC_OPTIMIZERS)))
CFLAGS_O += -fno-unsafe-loop-optimizations
endif
ifneq (,$(findstring -fstrict-overflow,$(GCC_OPTIMIZERS)))
CFLAGS_O += -fno-strict-overflow
endif
ifeq (,$(NO_LTO))
ifneq (,$(findstring -flto,$(GCC_OPTIMIZERS)))
CFLAGS_O += -flto -fwhole-program
LDFLAGS_O += -flto -fwhole-program
endif
endif
BUILD_FEATURES = - compiler optimizations and no debugging support
endif
ifneq (3,$(GCC_MAJOR_VERSION))
ifeq (,$(GCC_WARNINGS_CMD))
GCC_WARNINGS_CMD = $(GCC) --help=warnings
endif
ifneq (,$(findstring -Wunused-result,$(shell $(GCC_WARNINGS_CMD))))
CFLAGS_O += -Wno-unused-result
endif
endif
ifneq (clean,$(MAKECMDGOALS))
BUILD_FEATURES := $(BUILD_FEATURES). $(COMPILER_NAME)
$(info ***)
$(info *** $(BUILD_SINGLE)Simulator$(BUILD_MULTIPLE) being built with:)
$(info *** $(BUILD_FEATURES).)
ifneq (,$(NETWORK_FEATURES))
$(info *** $(NETWORK_FEATURES).)
endif
ifneq (,$(NETWORK_LAN_FEATURES))
$(info *** - Local LAN packet transports: $(NETWORK_LAN_FEATURES))
endif
ifneq (,$(VIDEO_FEATURES))
$(info *** $(VIDEO_FEATURES).)
endif
ifneq (,$(GIT_COMMIT_ID))
$(info ***)
$(info *** git commit id is $(GIT_COMMIT_ID).)
endif
$(info ***)
endif
ifneq ($(DONT_USE_ROMS),)
ROMS_OPT = -DDONT_USE_INTERNAL_ROM
else
BUILD_ROMS = ${BIN}BuildROMs${EXE}
endif
ifneq ($(DONT_USE_READER_THREAD),)
NETWORK_OPT += -DDONT_USE_READER_THREAD
endif
ifeq (HP-UX,$(OSTYPE))
CC_STD = -std=gnu99
else
ifeq (,$(SUNC_VERSION))
CC_STD = -std=c99
endif
endif
CC_OUTSPEC = -o $@
CC := $(GCC) $(CC_STD) -U__STRICT_ANSI__ $(CFLAGS_G) $(CFLAGS_O) $(CFLAGS_GIT) -DSIM_COMPILER="$(COMPILER_NAME)" -I . $(OS_CCDEFS) $(ROMS_OPT)
LDFLAGS := $(OS_LDFLAGS) $(NETWORK_LDFLAGS) $(LDFLAGS_O)
#
# Common Libraries
#
BIN = BIN/
SIM = scp.c sim_console.c sim_fio.c sim_timer.c sim_sock.c \
sim_tmxr.c sim_ether.c sim_tape.c sim_disk.c sim_serial.c \
sim_video.c
DISPLAYD = display
ifeq ($(WIN32),)
ifeq (x11,$(shell if $(TEST) -e /usr/include/X11/Intrinsic.h ; then echo x11; fi))
DISPLAYL = ${DISPLAYD}/display.c $(DISPLAYD)/x11.c
DISPLAYVT = ${DISPLAYD}/vt11.c
DISPLAY_OPT = -DUSE_DISPLAY -I/usr/X11/include -lXt -lX11 -lm
else
DISPLAYL =
DISPLAYVT =
DISPLAY_OPT =
endif
else
DISPLAYL = ${DISPLAYD}/display.c $(DISPLAYD)/win32.c
DISPLAYVT = ${DISPLAYD}/vt11.c
DISPLAY_OPT = -DUSE_DISPLAY -lgdi32
endif
#
# Emulator source files and compile time options
#
PDP1D = PDP1
PDP1 = ${PDP1D}/pdp1_lp.c ${PDP1D}/pdp1_cpu.c ${PDP1D}/pdp1_stddev.c \
${PDP1D}/pdp1_sys.c ${PDP1D}/pdp1_dt.c ${PDP1D}/pdp1_drm.c \
${PDP1D}/pdp1_clk.c ${PDP1D}/pdp1_dcs.c ${PDP1D}/pdp1_dpy.c ${DISPLAYL}
PDP1_OPT = -I ${PDP1D} $(DISPLAY_OPT)
NOVAD = NOVA
NOVA = ${NOVAD}/nova_sys.c ${NOVAD}/nova_cpu.c ${NOVAD}/nova_dkp.c \
${NOVAD}/nova_dsk.c ${NOVAD}/nova_lp.c ${NOVAD}/nova_mta.c \
${NOVAD}/nova_plt.c ${NOVAD}/nova_pt.c ${NOVAD}/nova_clk.c \
${NOVAD}/nova_tt.c ${NOVAD}/nova_tt1.c ${NOVAD}/nova_qty.c
NOVA_OPT = -I ${NOVAD}
ECLIPSE = ${NOVAD}/eclipse_cpu.c ${NOVAD}/eclipse_tt.c ${NOVAD}/nova_sys.c \
${NOVAD}/nova_dkp.c ${NOVAD}/nova_dsk.c ${NOVAD}/nova_lp.c \
${NOVAD}/nova_mta.c ${NOVAD}/nova_plt.c ${NOVAD}/nova_pt.c \
${NOVAD}/nova_clk.c ${NOVAD}/nova_tt1.c ${NOVAD}/nova_qty.c
ECLIPSE_OPT = -I ${NOVAD} -DECLIPSE
PDP18BD = PDP18B
PDP18B = ${PDP18BD}/pdp18b_dt.c ${PDP18BD}/pdp18b_drm.c ${PDP18BD}/pdp18b_cpu.c \
${PDP18BD}/pdp18b_lp.c ${PDP18BD}/pdp18b_mt.c ${PDP18BD}/pdp18b_rf.c \
${PDP18BD}/pdp18b_rp.c ${PDP18BD}/pdp18b_stddev.c ${PDP18BD}/pdp18b_sys.c \
${PDP18BD}/pdp18b_rb.c ${PDP18BD}/pdp18b_tt1.c ${PDP18BD}/pdp18b_fpp.c
PDP4_OPT = -DPDP4 -I ${PDP18BD}
PDP7_OPT = -DPDP7 -I ${PDP18BD}
PDP9_OPT = -DPDP9 -I ${PDP18BD}
PDP15_OPT = -DPDP15 -I ${PDP18BD}
PDP11D = PDP11
PDP11 = ${PDP11D}/pdp11_fp.c ${PDP11D}/pdp11_cpu.c ${PDP11D}/pdp11_dz.c \
${PDP11D}/pdp11_cis.c ${PDP11D}/pdp11_lp.c ${PDP11D}/pdp11_rk.c \
${PDP11D}/pdp11_rl.c ${PDP11D}/pdp11_rp.c ${PDP11D}/pdp11_rx.c \
${PDP11D}/pdp11_stddev.c ${PDP11D}/pdp11_sys.c ${PDP11D}/pdp11_tc.c \
${PDP11D}/pdp11_tm.c ${PDP11D}/pdp11_ts.c ${PDP11D}/pdp11_io.c \
${PDP11D}/pdp11_rq.c ${PDP11D}/pdp11_tq.c ${PDP11D}/pdp11_pclk.c \
${PDP11D}/pdp11_ry.c ${PDP11D}/pdp11_pt.c ${PDP11D}/pdp11_hk.c \
${PDP11D}/pdp11_xq.c ${PDP11D}/pdp11_xu.c ${PDP11D}/pdp11_vh.c \
${PDP11D}/pdp11_rh.c ${PDP11D}/pdp11_tu.c ${PDP11D}/pdp11_cpumod.c \
${PDP11D}/pdp11_cr.c ${PDP11D}/pdp11_rf.c ${PDP11D}/pdp11_dl.c \
${PDP11D}/pdp11_ta.c ${PDP11D}/pdp11_rc.c ${PDP11D}/pdp11_kg.c \
${PDP11D}/pdp11_ke.c ${PDP11D}/pdp11_dc.c ${PDP11D}/pdp11_dmc.c \
${PDP11D}/pdp11_kmc.c ${PDP11D}/pdp11_dup.c ${PDP11D}/pdp11_rs.c \
${PDP11D}/pdp11_vt.c ${PDP11D}/pdp11_io_lib.c $(DISPLAYL) $(DISPLAYVT)
PDP11_OPT = -DVM_PDP11 -I ${PDP11D} ${NETWORK_OPT} $(DISPLAY_OPT)
VAXD = VAX
VAX = ${VAXD}/vax_cpu.c ${VAXD}/vax_cpu1.c ${VAXD}/vax_fpa.c ${VAXD}/vax_io.c \
${VAXD}/vax_cis.c ${VAXD}/vax_octa.c ${VAXD}/vax_cmode.c \
${VAXD}/vax_mmu.c ${VAXD}/vax_stddev.c ${VAXD}/vax_sysdev.c \
${VAXD}/vax_sys.c ${VAXD}/vax_syscm.c ${VAXD}/vax_syslist.c \
${PDP11D}/pdp11_rl.c ${PDP11D}/pdp11_rq.c ${PDP11D}/pdp11_ts.c \
${PDP11D}/pdp11_dz.c ${PDP11D}/pdp11_lp.c ${PDP11D}/pdp11_tq.c \
${PDP11D}/pdp11_xq.c ${PDP11D}/pdp11_vh.c ${PDP11D}/pdp11_cr.c \
${PDP11D}/pdp11_io_lib.c
VAX_OPT = -DVM_VAX -DUSE_INT64 -DUSE_ADDR64 -I ${VAXD} -I ${PDP11D} ${NETWORK_OPT}
VAX610 = ${VAXD}/vax_cpu.c ${VAXD}/vax_cpu1.c ${VAXD}/vax_fpa.c \
${VAXD}/vax_cis.c ${VAXD}/vax_octa.c ${VAXD}/vax_cmode.c \
${VAXD}/vax_mmu.c ${VAXD}/vax_sys.c ${VAXD}/vax_syscm.c \
${VAXD}/vax610_stddev.c ${VAXD}/vax610_sysdev.c ${VAXD}/vax610_io.c \
${VAXD}/vax610_syslist.c ${VAXD}/vax610_mem.c ${VAXD}/vax_vc.c \
${VAXD}/vax_lk.c ${VAXD}/vax_vs.c ${VAXD}/vax_2681.c \
${PDP11D}/pdp11_rl.c ${PDP11D}/pdp11_rq.c ${PDP11D}/pdp11_ts.c \
${PDP11D}/pdp11_dz.c ${PDP11D}/pdp11_lp.c ${PDP11D}/pdp11_tq.c \
${PDP11D}/pdp11_xq.c ${PDP11D}/pdp11_vh.c ${PDP11D}/pdp11_cr.c \
${PDP11D}/pdp11_io_lib.c
VAX610_OPT = -DVM_VAX -DVAX_610 -DUSE_INT64 -DUSE_ADDR64 -DUSE_SIM_VIDEO -I ${VAXD} -I ${PDP11D} ${NETWORK_OPT}
VAX630 = ${VAXD}/vax_cpu.c ${VAXD}/vax_cpu1.c ${VAXD}/vax_fpa.c \
${VAXD}/vax_cis.c ${VAXD}/vax_octa.c ${VAXD}/vax_cmode.c \
${VAXD}/vax_mmu.c ${VAXD}/vax_sys.c ${VAXD}/vax_syscm.c \
${VAXD}/vax_watch.c ${VAXD}/vax630_stddev.c ${VAXD}/vax630_sysdev.c \
${VAXD}/vax630_io.c ${VAXD}/vax630_syslist.c ${VAXD}/vax_vc.c \
${VAXD}/vax_lk.c ${VAXD}/vax_vs.c ${VAXD}/vax_2681.c \
${PDP11D}/pdp11_rl.c ${PDP11D}/pdp11_rq.c ${PDP11D}/pdp11_ts.c \
${PDP11D}/pdp11_dz.c ${PDP11D}/pdp11_lp.c ${PDP11D}/pdp11_tq.c \
${PDP11D}/pdp11_xq.c ${PDP11D}/pdp11_vh.c ${PDP11D}/pdp11_cr.c \
${PDP11D}/pdp11_io_lib.c
VAX620_OPT = -DVM_VAX -DVAX_620 -DUSE_INT64 -DUSE_ADDR64 -I ${VAXD} -I ${PDP11D} ${NETWORK_OPT}
VAX630_OPT = -DVM_VAX -DVAX_630 -DUSE_INT64 -DUSE_ADDR64 -DUSE_SIM_VIDEO -I ${VAXD} -I ${PDP11D} ${NETWORK_OPT}
VAX730 = ${VAXD}/vax_cpu.c ${VAXD}/vax_cpu1.c ${VAXD}/vax_fpa.c \
${VAXD}/vax_cis.c ${VAXD}/vax_octa.c ${VAXD}/vax_cmode.c \
${VAXD}/vax_mmu.c ${VAXD}/vax_sys.c ${VAXD}/vax_syscm.c \
${VAXD}/vax730_stddev.c ${VAXD}/vax730_sys.c \
${VAXD}/vax730_mem.c ${VAXD}/vax730_uba.c ${VAXD}/vax730_rb.c \
${VAXD}/vax730_syslist.c \
${PDP11D}/pdp11_rl.c ${PDP11D}/pdp11_rq.c ${PDP11D}/pdp11_ts.c \
${PDP11D}/pdp11_dz.c ${PDP11D}/pdp11_lp.c ${PDP11D}/pdp11_tq.c \
${PDP11D}/pdp11_xu.c ${PDP11D}/pdp11_ry.c ${PDP11D}/pdp11_cr.c \
${PDP11D}/pdp11_hk.c ${PDP11D}/pdp11_vh.c ${PDP11D}/pdp11_dmc.c \
${PDP11D}/pdp11_dup.c ${PDP11D}/pdp11_io_lib.c
VAX730_OPT = -DVM_VAX -DVAX_730 -DUSE_INT64 -DUSE_ADDR64 -I VAX -I ${PDP11D} ${NETWORK_OPT}
VAX750 = ${VAXD}/vax_cpu.c ${VAXD}/vax_cpu1.c ${VAXD}/vax_fpa.c \
${VAXD}/vax_cis.c ${VAXD}/vax_octa.c ${VAXD}/vax_cmode.c \
${VAXD}/vax_mmu.c ${VAXD}/vax_sys.c ${VAXD}/vax_syscm.c \
${VAXD}/vax750_stddev.c ${VAXD}/vax750_cmi.c \
${VAXD}/vax750_mem.c ${VAXD}/vax750_uba.c ${VAXD}/vax7x0_mba.c \
${VAXD}/vax750_syslist.c \
${PDP11D}/pdp11_rl.c ${PDP11D}/pdp11_rq.c ${PDP11D}/pdp11_ts.c \
${PDP11D}/pdp11_dz.c ${PDP11D}/pdp11_lp.c ${PDP11D}/pdp11_tq.c \
${PDP11D}/pdp11_xu.c ${PDP11D}/pdp11_ry.c ${PDP11D}/pdp11_cr.c \
${PDP11D}/pdp11_hk.c ${PDP11D}/pdp11_rp.c ${PDP11D}/pdp11_tu.c \
${PDP11D}/pdp11_vh.c ${PDP11D}/pdp11_dmc.c ${PDP11D}/pdp11_dup.c \
${PDP11D}/pdp11_io_lib.c
VAX750_OPT = -DVM_VAX -DVAX_750 -DUSE_INT64 -DUSE_ADDR64 -I VAX -I ${PDP11D} ${NETWORK_OPT}
VAX780 = ${VAXD}/vax_cpu.c ${VAXD}/vax_cpu1.c ${VAXD}/vax_fpa.c \
${VAXD}/vax_cis.c ${VAXD}/vax_octa.c ${VAXD}/vax_cmode.c \
${VAXD}/vax_mmu.c ${VAXD}/vax_sys.c ${VAXD}/vax_syscm.c \
${VAXD}/vax780_stddev.c ${VAXD}/vax780_sbi.c \
${VAXD}/vax780_mem.c ${VAXD}/vax780_uba.c ${VAXD}/vax7x0_mba.c \
${VAXD}/vax780_fload.c ${VAXD}/vax780_syslist.c \
${PDP11D}/pdp11_rl.c ${PDP11D}/pdp11_rq.c ${PDP11D}/pdp11_ts.c \
${PDP11D}/pdp11_dz.c ${PDP11D}/pdp11_lp.c ${PDP11D}/pdp11_tq.c \
${PDP11D}/pdp11_xu.c ${PDP11D}/pdp11_ry.c ${PDP11D}/pdp11_cr.c \
${PDP11D}/pdp11_rp.c ${PDP11D}/pdp11_tu.c ${PDP11D}/pdp11_hk.c \
${PDP11D}/pdp11_vh.c ${PDP11D}/pdp11_dmc.c ${PDP11D}/pdp11_dup.c \
${PDP11D}/pdp11_io_lib.c
VAX780_OPT = -DVM_VAX -DVAX_780 -DUSE_INT64 -DUSE_ADDR64 -I VAX -I ${PDP11D} ${NETWORK_OPT}
VAX8600 = ${VAXD}/vax_cpu.c ${VAXD}/vax_cpu1.c ${VAXD}/vax_fpa.c \
${VAXD}/vax_cis.c ${VAXD}/vax_octa.c ${VAXD}/vax_cmode.c \
${VAXD}/vax_mmu.c ${VAXD}/vax_sys.c ${VAXD}/vax_syscm.c \
${VAXD}/vax860_stddev.c ${VAXD}/vax860_sbia.c \
${VAXD}/vax860_abus.c ${VAXD}/vax780_uba.c ${VAXD}/vax7x0_mba.c \
${VAXD}/vax860_syslist.c \
${PDP11D}/pdp11_rl.c ${PDP11D}/pdp11_rq.c ${PDP11D}/pdp11_ts.c \
${PDP11D}/pdp11_dz.c ${PDP11D}/pdp11_lp.c ${PDP11D}/pdp11_tq.c \
${PDP11D}/pdp11_xu.c ${PDP11D}/pdp11_ry.c ${PDP11D}/pdp11_cr.c \
${PDP11D}/pdp11_rp.c ${PDP11D}/pdp11_tu.c ${PDP11D}/pdp11_hk.c \
${PDP11D}/pdp11_vh.c ${PDP11D}/pdp11_dmc.c ${PDP11D}/pdp11_dup.c \
${PDP11D}/pdp11_io_lib.c
VAX8600_OPT = -DVM_VAX -DVAX_860 -DUSE_INT64 -DUSE_ADDR64 -I VAX -I ${PDP11D} ${NETWORK_OPT}
PDP10D = PDP10
PDP10 = ${PDP10D}/pdp10_fe.c ${PDP11D}/pdp11_dz.c ${PDP10D}/pdp10_cpu.c \
${PDP10D}/pdp10_ksio.c ${PDP10D}/pdp10_lp20.c ${PDP10D}/pdp10_mdfp.c \
${PDP10D}/pdp10_pag.c ${PDP10D}/pdp10_rp.c ${PDP10D}/pdp10_sys.c \
${PDP10D}/pdp10_tim.c ${PDP10D}/pdp10_tu.c ${PDP10D}/pdp10_xtnd.c \
${PDP11D}/pdp11_pt.c ${PDP11D}/pdp11_ry.c ${PDP11D}/pdp11_cr.c \
${PDP11D}/pdp11_dup.c ${PDP11D}/pdp11_dmc.c ${PDP11D}/pdp11_kmc.c
PDP10_OPT = -DVM_PDP10 -DUSE_INT64 -I ${PDP10D} -I ${PDP11D}
PDP8D = PDP8
PDP8 = ${PDP8D}/pdp8_cpu.c ${PDP8D}/pdp8_clk.c ${PDP8D}/pdp8_df.c \
${PDP8D}/pdp8_dt.c ${PDP8D}/pdp8_lp.c ${PDP8D}/pdp8_mt.c \
${PDP8D}/pdp8_pt.c ${PDP8D}/pdp8_rf.c ${PDP8D}/pdp8_rk.c \
${PDP8D}/pdp8_rx.c ${PDP8D}/pdp8_sys.c ${PDP8D}/pdp8_tt.c \
${PDP8D}/pdp8_ttx.c ${PDP8D}/pdp8_rl.c ${PDP8D}/pdp8_tsc.c \
${PDP8D}/pdp8_td.c ${PDP8D}/pdp8_ct.c ${PDP8D}/pdp8_fpp.c
PDP8_OPT = -I ${PDP8D}
H316D = H316
H316 = ${H316D}/h316_stddev.c ${H316D}/h316_lp.c ${H316D}/h316_cpu.c \
${H316D}/h316_sys.c ${H316D}/h316_mt.c ${H316D}/h316_fhd.c \
${H316D}/h316_dp.c ${H316D}/h316_rtc.c ${H316D}/h316_imp.c \
${H316D}/h316_hi.c ${H316D}/h316_mi.c ${H316D}/h316_udp.c
H316_OPT = -I ${H316D} -D VM_IMPTIP
HP2100D = HP2100
HP2100 = ${HP2100D}/hp2100_stddev.c ${HP2100D}/hp2100_dp.c ${HP2100D}/hp2100_dq.c \
${HP2100D}/hp2100_dr.c ${HP2100D}/hp2100_lps.c ${HP2100D}/hp2100_ms.c \
${HP2100D}/hp2100_mt.c ${HP2100D}/hp2100_mux.c ${HP2100D}/hp2100_cpu.c \
${HP2100D}/hp2100_fp.c ${HP2100D}/hp2100_sys.c ${HP2100D}/hp2100_lpt.c \
${HP2100D}/hp2100_ipl.c ${HP2100D}/hp2100_ds.c ${HP2100D}/hp2100_cpu0.c \
${HP2100D}/hp2100_cpu1.c ${HP2100D}/hp2100_cpu2.c ${HP2100D}/hp2100_cpu3.c \
${HP2100D}/hp2100_cpu4.c ${HP2100D}/hp2100_cpu5.c ${HP2100D}/hp2100_cpu6.c \
${HP2100D}/hp2100_cpu7.c ${HP2100D}/hp2100_fp1.c ${HP2100D}/hp2100_baci.c \
${HP2100D}/hp2100_mpx.c ${HP2100D}/hp2100_pif.c ${HP2100D}/hp2100_di.c \
${HP2100D}/hp2100_di_da.c ${HP2100D}/hp_disclib.c
HP2100_OPT = -DHAVE_INT64 -I ${HP2100D}
I1401D = I1401
I1401 = ${I1401D}/i1401_lp.c ${I1401D}/i1401_cpu.c ${I1401D}/i1401_iq.c \
${I1401D}/i1401_cd.c ${I1401D}/i1401_mt.c ${I1401D}/i1401_dp.c \
${I1401D}/i1401_sys.c
I1401_OPT = -I ${I1401D}
I1620D = I1620
I1620 = ${I1620D}/i1620_cd.c ${I1620D}/i1620_dp.c ${I1620D}/i1620_pt.c \
${I1620D}/i1620_tty.c ${I1620D}/i1620_cpu.c ${I1620D}/i1620_lp.c \
${I1620D}/i1620_fp.c ${I1620D}/i1620_sys.c
I1620_OPT = -I ${I1620D}
I7094D = I7094
I7094 = ${I7094D}/i7094_cpu.c ${I7094D}/i7094_cpu1.c ${I7094D}/i7094_io.c \
${I7094D}/i7094_cd.c ${I7094D}/i7094_clk.c ${I7094D}/i7094_com.c \
${I7094D}/i7094_drm.c ${I7094D}/i7094_dsk.c ${I7094D}/i7094_sys.c \
${I7094D}/i7094_lp.c ${I7094D}/i7094_mt.c ${I7094D}/i7094_binloader.c
I7094_OPT = -DUSE_INT64 -I ${I7094D}
IBM1130D = Ibm1130
IBM1130 = ${IBM1130D}/ibm1130_cpu.c ${IBM1130D}/ibm1130_cr.c \
${IBM1130D}/ibm1130_disk.c ${IBM1130D}/ibm1130_stddev.c \
${IBM1130D}/ibm1130_sys.c ${IBM1130D}/ibm1130_gdu.c \
${IBM1130D}/ibm1130_gui.c ${IBM1130D}/ibm1130_prt.c \
${IBM1130D}/ibm1130_fmt.c ${IBM1130D}/ibm1130_ptrp.c \
${IBM1130D}/ibm1130_plot.c ${IBM1130D}/ibm1130_sca.c \
${IBM1130D}/ibm1130_t2741.c
IBM1130_OPT = -I ${IBM1130D}
ifneq ($(WIN32),)
IBM1130_OPT += -DGUI_SUPPORT -lgdi32
endif