forked from ToyotaResearchInstitute/vrpn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
1018 lines (897 loc) · 27.4 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
#############################################################################
# Makefile for VRPN libraries. Needs to be built using 'gmake'.
# Should run on any architecture that is currently supported. It should
# be possible to build simultaneously on multiple architectures.
#
# On the sgi, both g++ and CC versions are built by default.
#
# Author: Russ Taylor, 10/2/1997
#
# modified:
# * Andrew Roth June 16/2012
# * Updates for MacOSX builds for 32/64, 64 bit and Xcode 4.3
# * Jeff Juliano, 10/99
# * added "make depend" (see comments at end of this makefile)
# * changed to use RM, RMF, MV, and MVF
# these are overridable as follows:
# gmake RM=/mybin/rm, or gmake RMF="/bin/rm -option"
# * Jeff Juliano, 9/1999
# support for parallel make (see WARNING below)
# * Tom Hudson, 25 Jun 1998
# Support for n32 ABI on sgi. (gmake n32)
# * Hans Weber, ???
# Support for both g++ and native compilers on sgi.
# * Tom Hudson, 13 Feb 1998
# Build two different libraries: client (libvrpn) and server
# (libvrpnserver). Our solution is to compile twice, once with the
# flag -DVRPN_CLIENT_ONLY and once without. Any server-specific code
# (vrpn_3Space, vrpn_Tracker_Fastrak, vrpn_Flock) should ONLY be
# compiled into the server library!
#############################################################################
##########################
# common definitions. For non-UNC sites, uncomment one of the lines
# that defines hw_os for the machine you are on in the section just
# below. Then, the code should compile in your environment.
#
#HW_OS := sgi_irix
#HW_OS := pc_linux
#HW_OS := pc_linux64
#HW_OS := pc_linux_ia64
# Try this to cross-compile on a Linux PC for an ARM embedded controller.
#HW_OS := pc_linux_arm
# Try this to cross-compile on a Cygwin PC for an ARM embedded controller.
#HW_OS := pc_cygwin_arm
#HW_OS := pc_cygwin
#HW_OS := pc_FreeBSD
#HW_OS := sparc_solaris
#HW_OS := sparc_solaris_64
#HW_OS := powerpc_aix
#HW_OS := powerpc_macosx
#HW_OS := universal_macosx
#HW_OS := macosx_32_64
#HW_OS := macosx_64
##########################
##########################
# Mac OS X-specific options. If HW_OS is powerpc_macosx or universal_macosx,
# uncomment one line below to choose the minimum targeted OS X version and
# corresponding SDK. If none of the lines below is commented out, 10.5 will
# be the minimum version. 10.7/4.3 removes ppc support. In Xcode 4.3 - you
# must now manually install command line tools from:
# Xcode menu > Preferences > Downloads.
##########################
#MAC_OS_MIN_VERSION := 10.4
#MAC_OS_MIN_VERSION := 10.5
#MAC_OS_MIN_VERSION := 10.6
#MAC_OS_MIN_VERSION := 10.7
#MAC_OS_MIN_VERSION := 10.8
INSTALL_DIR := /usr/local
BIN_DIR := $(INSTALL_DIR)/bin
INCLUDE_DIR := $(INSTALL_DIR)/include
LIB_DIR := $(INSTALL_DIR)/lib
MV = /bin/mv
MVF = $(MV) -f
RM = /bin/rm
RMF = $(RM) -f
ifndef HW_OS
# hw_os does not exist on FreeBSD at UNC or on CYGWIN
UNAME := $(shell uname -s)
ifeq ($(UNAME), FreeBSD)
HW_OS := pc_FreeBSD
else
# pc_cygwin doesn't have HW_OS
ifeq ($(UNAME), CYGWIN_NT-4.0)
HW_OS := pc_cygwin
# On cygwin make is gmake (and gmake doesn't exist)
MAKE := make -f $(MAKEFILE)
else
ifeq ($(UNAME), CYGWIN_98-4.10)
HW_OS := pc_cygwin
MAKE := make -f $(MAKEFILE)
else
ifeq ($(UNAME), CYGWIN_NT-5.0)
HW_OS := pc_cygwin
MAKE := make -f $(MAKEFILE)
else
HW_OS := $(shell hw_os)
endif
endif
endif
endif
endif
# check if its for pxfl
ifdef PBASE_ROOT
HW_OS := hp_flow
ifeq ($(PXFL_COMPILER), aCC)
HW_OS = hp_flow_aCC
endif
endif
ifeq (,$(strip $(HW_OS)))
$(error You must define HW_OS when calling make. See the makefile for example values)
all:
@echo "ERROR: You must define HW_OS when calling make. See the makefile for example values." 1>&2
endif
# Which C++ compiler to use. Default is g++, but some don't use this.
#
# IF YOU CHANGE THESE, document either here or in the header comment
# why. Multiple contradictory changes have been made recently.
# These should be defaulting to useful values on the platform.
# If they aren't, use gcc.
# C compiler
CC ?= gcc
# C++ compiler
CXX ?= g++
# These probably aren't defaulting to anything useful.
AR := ar ruv
# need default 'ranlib' to be touch for platforms that don't use it,
# otherwise make fails.
RANLIB ?= touch
ifeq ($(FORCE_GPP),1)
CC := g++
else
ifeq ($(HW_OS),sparc_solaris)
CC := /opt/SUNWspro/bin/CC
AR := /opt/SUNWspro/bin/CC -xar -o
endif
ifeq ($(HW_OS),sparc_solaris_64)
CC := /opt/SUNWspro/bin/CC -xarch=v9a
AR := /opt/SUNWspro/bin/CC -xarch=v9a -xar -o
endif
ifeq ($(HW_OS),powerpc_aix)
CC := /usr/ibmcxx/bin/xlC_r -g -qarch=pwr3 -w
RANLIB := ranlib
endif
ifeq ($(HW_OS),pc_linux64)
STANDARD_CFLAGS := -m64 -fPIC
RANLIB := ranlib
endif
ifeq ($(HW_OS),pc_linux)
STANDARD_CFLAGS := -fPIC
RANLIB := ranlib
endif
ifeq ($(HW_OS), pc_linux_ia64)
RANLIB := ranlib
endif
ifneq (,$(findstring macosx,$(HW_OS)))
ifndef MAC_OS_MIN_VERSION
MAC_OS_MIN_VERSION := 10.5
endif
# Select which compiler and MAC OS X SDK to use
MAC_CC := gcc
MAC_CXX := g++
ifeq ($(MAC_OS_MIN_VERSION), 10.8)
MAC_OS_SDK := MacOSX10.8.sdk
else
ifeq ($(MAC_OS_MIN_VERSION), 10.7)
MAC_OS_SDK := MacOSX10.7.sdk
else
ifeq ($(MAC_OS_MIN_VERSION), 10.6)
MAC_OS_SDK := MacOSX10.6.sdk
else
ifeq ($(MAC_OS_MIN_VERSION), 10.5)
MAC_OS_SDK := MacOSX10.5.sdk
else
MAC_OS_SDK := MacOSX10.4u.sdk
MAC_CC := gcc-4.0
MAC_CXX := g++-4.0
endif
endif
endif
endif
endif
ifneq (,$(findstring macosx,$(HW_OS)))
ifeq ($(wildcard /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/$(MAC_OS_SDK)),/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/$(MAC_OS_SDK))
PATH_TO_DEV := /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/$(MAC_OS_SDK)
$(info ---> Xcode 4.3+: Platform SDK found. Setting dev path to $(PATH_TO_DEV))
else
PATH_TO_DEV := /Developer/SDKs/$(MAC_OS_SDK)
$(info Xcode 4.3+: Platform SDK not found in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/$(MAC_OS_SDK)! Attempting to locate SDK in $(PATH_TO_DEV))
endif
CC := $(MAC_CC)
CXX := $(MAC_CXX)
STANDARD_CFLAGS := -isysroot /Developer/SDKs/$(MAC_OS_SDK) -mmacosx-version-min=$(MAC_OS_MIN_VERSION)
SYSLIBS := -framework CoreFoundation -framework IOKit -framework System
endif
ifeq ($(HW_OS),powerpc_macosx)
STANDARD_CFLAGS := -arch ppc $(STANDARD_CFLAGS)
RANLIB := ranlib
AR := libtool -static -o
endif
ifeq ($(HW_OS),universal_macosx)
STANDARD_CFLAGS := -arch ppc -arch i386 -arch x86_64 $(STANDARD_CFLAGS)
RANLIB := :
AR := libtool -static -o
endif
ifeq ($(HW_OS),macosx_32_64)
STANDARD_CFLAGS := -arch i386 -arch x86_64 $(STANDARD_CFLAGS)
RANLIB := :
AR := libtool -static -o
endif
ifeq ($(HW_OS),macosx_64)
STANDARD_CFLAGS := -arch x86_64 $(STANDARD_CFLAGS)
RANLIB := :
AR := libtool -static -o
endif
ifeq ($(HW_OS),pc_linux_arm)
CC := arm-linux-gcc
CXX := arm-linux-g++
RANLIB := arm-linux-ranlib
AR := arm-linux-ar ruv
endif
ifeq ($(HW_OS),pc_cygwin_arm)
CC := arm-unknown-linux-gnu-gcc
CXX := arm-unknown-linux-gnu-g++
RANLIB := arm-unknown-linux-gnu-ranlib
AR := arm-unknown-linux-gnu-ar ruv
endif
ifeq ($(HW_OS),sgi_irix)
ifndef SGI_ABI
SGI_ABI := n32
endif
ifndef SGI_ARCH
SGI_ARCH := mips3
endif
OBJECT_DIR_SUFFIX := .$(SGI_ABI).$(SGI_ARCH)
CC := CC -$(SGI_ABI) -$(SGI_ARCH) -LANG:std
RANLIB := :
endif
ifeq ($(HW_OS),hp700_hpux10)
CC := CC +a1
endif
ifeq ($(HW_OS),pc_cygwin)
CC := g++
endif
ifeq ($(HW_OS),sparc_sunos)
CC := /usr/local/lib/CenterLine/bin/CC
endif
ifeq ($(HW_OS), hp_flow_aCC)
CC := /opt/aCC/bin/aCC
endif
endif
#ifeq ($(HW_OS),sparc_solaris)
# AR := /usr/ccs/bin/ar
#endif
##########################
# directories
#
# subdirectory for make
ifeq ($(FORCE_GPP),1)
OBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX)/g++
SOBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX)/g++/server
AOBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX)/atmellib
GOBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX)/gpsnmealib
else
UNQUAL_OBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX)
UNQUAL_SOBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX)/server
UNQUAL_AOBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX)/atmellib
UNQUAL_GOBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX)/gpsnmealib
OBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX)
SOBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX)/server
AOBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX)/atmellib
GOBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX)/gpsnmealib
endif
# directories that we can do an rm -f on because they only contain
# object files and executables
SAFE_KNOWN_ARCHITECTURES := \
hp700_hpux/* \
hp700_hpux10/* \
mips_ultrix/* \
pc_linux/* \
sgi_irix.32/* \
sgi_irix.n32/* \
sparc_solaris/* \
sparc_solaris_64/* \
sparc_sunos/* \
pc_cygwin/* \
powerpc_aix/* \
pc_linux_arm/* \
powerpc_macosx/* \
universal_macosx/* \
macosx_32_64/* \
macosx_64/* \
pc_linux64/* \
pc_linux_ia64/*
CLIENT_SKA = $(patsubst %,client_src/%,$(SAFE_KNOWN_ARCHITECTURES))
SERVER_SKA = $(patsubst %,server_src/%,$(SAFE_KNOWN_ARCHITECTURES))
##########################
# Include flags
#
#SYS_INCLUDE := -I/usr/local/contrib/include -I/usr/local/contrib/mod/include
SYS_INCLUDE :=
ifeq ($(HW_OS),powerpc_macosx)
# SYS_INCLUDE := -I/usr/include
SYS_INCLUDE :=-DMACOSX -I../isense
endif
ifeq ($(HW_OS),universal_macosx)
# SYS_INCLUDE := -I/usr/include
SYS_INCLUDE :=-DMACOSX -I../isense
endif
ifeq ($(HW_OS),macosx_32_64)
# SYS_INCLUDE := -I/usr/include
SYS_INCLUDE :=-DMACOSX -I../isense
endif
ifeq ($(HW_OS),macosx_64)
# SYS_INCLUDE := -I/usr/include
SYS_INCLUDE :=-DMACOSX -I../isense
endif
ifeq ($(HW_OS),pc_linux)
# The following is for the InterSense and Freespace libraries.
SYS_INCLUDE := -DUNIX -DLINUX -I../libfreespace/include -I./submodules/hidapi/hidapi -I/usr/include/libusb-1.0
# On linux, build this as c, not c++.
$(HW_OS)/server/vrpn_Local_HIDAPI.o: EXTRA_FLAGS += -x c
endif
ifeq ($(HW_OS),pc_linux64)
# The following is for the InterSense and Freespace libraries.
SYS_INCLUDE := -DUNIX -DLINUX -I../libfreespace/include -I./submodules/hidapi/hidapi -I/usr/include/libusb-1.0
# On linux, build this as c, not c++.
$(HW_OS)/server/vrpn_Local_HIDAPI.o: EXTRA_FLAGS += -x c
endif
ifeq ($(HW_OS),pc_linux_arm)
SYS_INCLUDE := -I/opt/Embedix/arm-linux/include
# -I/usr/local/contrib/include \
# -I/usr/local/contrib/mod/include -I/usr/include/bsd \
# -I/usr/include/g++
endif
ifeq ($(HW_OS),pc_cygwin_arm)
SYS_INCLUDE := -I/opt/Embedix/arm-linux/include
# -I/usr/local/contrib/include \
# -I/usr/local/contrib/mod/include -I/usr/include/bsd \
# -I/usr/include/g++
endif
ifeq ($(HW_OS),sgi_irix)
# SYS_INCLUDE := -I/usr/local/contrib/mod/include
SYS_INCLUDE :=
endif
ifeq ($(HW_OS),hp700_hpux10)
SYS_INCLUDE := -I/usr/local/contrib/include -I/usr/local/contrib/mod/include \
-I/usr/include/bsd
endif
ifeq ($(HW_OS),hp_flow)
SYS_INCLUDE := -I/usr/local/contrib/include -I/usr/local/contrib/mod/include \
-I/usr/include/bsd -DFLOW
endif
ifeq ($(HW_OS),hp_flow_aCC)
SYS_INCLUDE := -I/usr/local/contrib/include -I/usr/local/contrib/mod/include \
-I/usr/include/bsd -DFLOW
endif
# On the PC, place quatlib in the directory ./quat. No actual system
# includes should be needed.
ifeq ($(HW_OS),pc_cygwin)
SYS_INCLUDE := -I./submodules/hidapi/hidapi -I/usr/include/libusb-1.0
INCLUDE_FLAGS := -I. -I./quat -I./atmellib -I./gpsnmealib ${SYS_INCLUDE}
else
INCLUDE_FLAGS := -I. $(SYS_INCLUDE) -I./quat -I../quat -I./atmellib -I./gpsnmealib
endif
##########################
# Load flags
#
#LOAD_FLAGS := -L./$(HW_OS)$(OBJECT_DIR_SUFFIX) -L/usr/local/lib \
# -L/usr/local/contrib/unmod/lib -L/usr/local/contrib/mod/lib -g
LOAD_FLAGS := -L./$(HW_OS)$(OBJECT_DIR_SUFFIX) -L/usr/local/lib \
-L/usr/local/contrib/unmod/lib -L/usr/local/contrib/mod/lib $(DEBUG_FLAGS) $(LDFLAGS)
ifeq ($(HW_OS),sgi_irix)
LOAD_FLAGS := $(LOAD_FLAGS) -old_ld -LANG:std
endif
ifeq ($(HW_OS),pc_linux)
LOAD_FLAGS := $(LOAD_FLAGS) -L/usr/X11R6/lib
endif
ifeq ($(HW_OS),pc_linux_ia64)
LOAD_FLAGS := $(LOAD_FLAGS) -L/usr/X11R6/lib
endif
ifeq ($(HW_OS),pc_linux64)
LOAD_FLAGS := $(LOAD_FLAGS) -L/usr/X11R6/lib
endif
##########################
# Libraries
#
ifeq ($(HW_OS),pc_linux64)
ARCH_LIBS := -lbsd -ldl
else
ifeq ($(HW_OS),pc_linux)
ARCH_LIBS := -lbsd -ldl
else
ifeq ($(HW_OS),pc_linux_ia64)
ARCH_LIBS := -lbsd -ldl
else
ifeq ($(HW_OS),sparc_solaris)
ARCH_LIBS := -lsocket -lnsl
else
ifeq ($(HW_OS),sparc_solaris_64)
ARCH_LIBS := -lsocket -lnsl
else
ARCH_LIBS :=
endif
endif
endif
endif
endif
LIBS := -lquat -lsdi $(TCL_LIBS) -lXext -lX11 $(ARCH_LIBS) -lm
#
# Defines for the compilation, CFLAGS
#
#CFLAGS := $(INCLUDE_FLAGS) -g
ALL_CFLAGS = $(STANDARD_CFLAGS) $(INCLUDE_FLAGS) $(DEBUG_FLAGS) $(CFLAGS) $(EXTRA_FLAGS)
ALL_CXXFLAGS = $(STANDARD_CFLAGS) $(INCLUDE_FLAGS) $(DEBUG_FLAGS) $(CXXFLAGS) $(EXTRA_FLAGS)
# If we're building for sgi_irix, we need both g++ and non-g++ versions,
# unless we're building for one of the weird ABIs, which are only supported
# by the native compiler.
all: client server atmellib gpsnmealib
ifeq ($(HW_OS),sgi_irix)
ifeq ($(SGI_ABI),32)
# Also build the G++ versions
all: client_g++ server_g++
endif
endif
.PHONY: client_g++
client_g++:
$(MAKE) FORCE_GPP=1 $(UNQUAL_OBJECT_DIR)/g++/libvrpn.a
$(MV) $(UNQUAL_OBJECT_DIR)/g++/libvrpn.a $(UNQUAL_OBJECT_DIR)/libvrpn_g++.a
.PHONY: server_g++
server_g++:
$(MAKE) FORCE_GPP=1 $(UNQUAL_OBJECT_DIR)/g++/libvrpnserver.a
$(MV) $(UNQUAL_OBJECT_DIR)/g++/libvrpnserver.a $(UNQUAL_OBJECT_DIR)/libvrpnserver_g++.a
.PHONY: client
client: $(OBJECT_DIR) $(OBJECT_DIR)/libvrpn.a
.PHONY: server
server: $(SOBJECT_DIR) $(OBJECT_DIR)/libvrpnserver.a
.PHONY: atmellib
atmellib: $(AOBJECT_DIR) $(OBJECT_DIR)/libvrpnatmel.a
.PHONY: gpsnmealib
gpsnmealib: $(GOBJECT_DIR) $(OBJECT_DIR)/libvrpngpsnmea.a
$(OBJECT_DIR):
-mkdir -p $@
$(SOBJECT_DIR):
-mkdir -p $@
$(AOBJECT_DIR):
-mkdir -p $@
$(GOBJECT_DIR):
-mkdir -p $@
#############################################################################
#
# implicit rule for all .c files
#
.SUFFIXES: .c .C .o .a
.c.o:
$(CC) $(ALL_CFLAGS) -c $< -o $@
.C.o:
$(CXX) $(ALL_CXXFLAGS) -c $< -o $@
# Build client-only objects from .c files
$(OBJECT_DIR)/%.o: %.c $(LIB_INCLUDES) $(MAKEFILE) $(OBJECT_DIR)
$(CC) $(ALL_CFLAGS) -DVRPN_CLIENT_ONLY -o $@ -c $<
# Build client-only objects from .C files
$(OBJECT_DIR)/%.o: %.C $(LIB_INCLUDES) $(MAKEFILE) $(OBJECT_DIR)
$(CC) $(ALL_CXXFLAGS) -DVRPN_CLIENT_ONLY -o $@ -c $<
# # Build objects from .C files
$(SOBJECT_DIR)/%.o: %.C $(SLIB_INCLUDES) $(MAKEFILE) $(SOBJECT_DIR)
$(CXX) $(ALL_CFLAGS) -o $@ -c $<
# # Build objects from .C files
$(AOBJECT_DIR)/%.o: %.C $(ALIB_INCLUDES) $(MAKEFILE) $(AOBJECT_DIR)
$(CXX) $(ALL_CXXFLAGS) -o $@ -c $<
#
#
#############################################################################
#############################################################################
#
# library code
#
#############################################################################
# files to be compiled into the client library
# Please keep sorted (case-sensitive)!
LIB_FILES = \
vrpn_Analog.C \
vrpn_Analog_Output.C \
vrpn_Auxiliary_Logger.C \
vrpn_BaseClass.C \
vrpn_Button.C \
vrpn_Connection.C \
vrpn_Dial.C \
vrpn_EndpointContainer.C \
vrpn_FileConnection.C \
vrpn_FileController.C \
vrpn_ForceDevice.C \
vrpn_Forwarder.C \
vrpn_ForwarderController.C \
vrpn_Imager.C \
vrpn_LamportClock.C \
vrpn_Mutex.C \
vrpn_Poser.C \
vrpn_RedundantTransmission.C \
vrpn_Serial.C \
vrpn_Shared.C \
vrpn_SharedObject.C \
vrpn_Sound.C \
vrpn_Text.C \
vrpn_Thread.C \
vrpn_Tracker.C
LIB_OBJECTS = $(patsubst %,$(OBJECT_DIR)/%,$(LIB_FILES:.C=.o))
# Please keep sorted (case-sensitive)!
LIB_INCLUDES = \
vrpn_Analog.h \
vrpn_Analog_Output.h \
vrpn_Auxiliary_Logger.h \
vrpn_BaseClass.h \
vrpn_BufferUtils.h \
vrpn_Button.h \
vrpn_Connection.h \
vrpn_Dial.h \
vrpn_EndpointContainer.h \
vrpn_FileConnection.h \
vrpn_FileController.h \
vrpn_ForceDevice.h \
vrpn_Forwarder.h \
vrpn_ForwarderController.h \
vrpn_Imager.h \
vrpn_LamportClock.h \
vrpn_MainloopContainer.h \
vrpn_MainloopObject.h \
vrpn_Mutex.h \
vrpn_Poser.h \
vrpn_SendTextMessageStreamProxy.h \
vrpn_Serial.h \
vrpn_Shared.h \
vrpn_SharedObject.h \
vrpn_Sound.h \
vrpn_Text.h \
vrpn_Thread.h \
vrpn_Tracker.h \
vrpn_WindowsH.h \
# $(LIB_OBJECTS):
$(OBJECT_DIR)/libvrpn.a: $(MAKEFILE) $(LIB_OBJECTS)
$(AR) $(OBJECT_DIR)/libvrpn.a $(LIB_OBJECTS)
-$(RANLIB) $(OBJECT_DIR)/libvrpn.a
# We aren't going to use architecture-dependent sets of files.
# If vrpn_sgibox isn't supposed to be compiled on any other architecture,
# then put all of it inside "#ifdef sgi"!
# Please keep sorted (case-sensitive)!
SLIB_FILES = $(LIB_FILES) \
vrpn_3DConnexion.C \
vrpn_3DMicroscribe.C \
vrpn_3Space.C \
vrpn_5DT16.C \
vrpn_ADBox.C \
vrpn_Analog_5dt.C \
vrpn_Analog_5dtUSB.C \
vrpn_Analog_Radamec_SPI.C \
vrpn_Analog_USDigital_A2.C \
vrpn_Atmel.C \
vrpn_BiosciencesTools.C \
vrpn_Button_NI_DIO24.C \
vrpn_CHProducts_Controller_Raw.C \
vrpn_CerealBox.C \
vrpn_Contour.C \
vrpn_DreamCheeky.C \
vrpn_Dyna.C \
vrpn_Event.C \
vrpn_Event_Analog.C \
vrpn_Event_Mouse.C \
vrpn_Flock.C \
vrpn_Flock_Parallel.C \
vrpn_ForceDeviceServer.C \
vrpn_Freespace.C \
vrpn_FunctionGenerator.C \
vrpn_Futaba.C \
vrpn_GlobalHapticsOrb.C \
vrpn_Griffin.C \
vrpn_HumanInterface.C \
vrpn_IDEA.C \
vrpn_Imager_Stream_Buffer.C \
vrpn_ImmersionBox.C \
vrpn_JoyFly.C \
vrpn_Joylin.C \
vrpn_Keyboard.C \
vrpn_Laputa.C \
vrpn_LUDL.C \
vrpn_Local_HIDAPI.C \
vrpn_Logitech_Controller_Raw.C \
vrpn_Magellan.C \
vrpn_Microsoft_Controller_Raw.C \
vrpn_Mouse.C \
vrpn_NationalInstruments.C \
vrpn_nVidia_shield_controller.C \
vrpn_Oculus.C \
vrpn_OmegaTemperature.C \
vrpn_Poser_Analog.C \
vrpn_Poser_Tek4662.C \
vrpn_Retrolink.C \
vrpn_Saitek_Controller_Raw.C \
vrpn_Spaceball.C \
vrpn_Streaming_Arduino.C \
vrpn_Tng3.C \
vrpn_Tracker_3DMouse.C \
vrpn_Tracker_AnalogFly.C \
vrpn_Tracker_ButtonFly.C \
vrpn_Tracker_Crossbow.C \
vrpn_Tracker_DTrack.C \
vrpn_Tracker_Fastrak.C \
vrpn_Tracker_Filter.C \
vrpn_Tracker_GPS.C \
vrpn_Tracker_GameTrak.C \
vrpn_Tracker_IMU.C \
vrpn_Tracker_Isotrak.C \
vrpn_Tracker_Liberty.C \
vrpn_Tracker_LibertyHS.C \
vrpn_Tracker_MotionNode.C \
vrpn_Tracker_NDI_Polaris.C \
vrpn_Tracker_NovintFalcon.C \
vrpn_Tracker_OSVRHackerDevKit.C \
vrpn_Tracker_PDI.C \
vrpn_Tracker_PhaseSpace.C \
vrpn_Tracker_RazerHydra.C \
vrpn_Tracker_SpacePoint.C \
vrpn_Tracker_TrivisioColibri.C \
vrpn_Tracker_ViewPoint.C \
vrpn_Tracker_WiimoteHead.C \
vrpn_Tracker_Wintracker.C \
vrpn_Tracker_isense.C \
vrpn_UNC_Joystick.C \
vrpn_Vality.C \
vrpn_VPJoystick.C \
vrpn_Wanda.C \
vrpn_WiiMote.C \
vrpn_Xkeys.C \
vrpn_YEI_3Space.C \
vrpn_Zaber.C \
vrpn_inertiamouse.C \
vrpn_nikon_controls.C \
vrpn_raw_sgibox.C \
vrpn_sgibox.C \
SLIB_OBJECTS = $(patsubst %,$(SOBJECT_DIR)/%,$(SLIB_FILES:.C=.o))
# Please keep sorted (case-sensitive)!
SLIB_INCLUDES = $(LIB_INCLUDES) \
vrpn_3DConnexion.h \
vrpn_3DMicroscribe.h \
vrpn_3Space.h \
vrpn_5DT16.h \
vrpn_ADBox.h \
vrpn_Analog_5dt.h \
vrpn_Analog_5dtUSB.h \
vrpn_Analog_Radamec_SPI.h \
vrpn_Analog_USDigital_A2.h \
vrpn_Atmel.h \
vrpn_BiosciencesTools.h \
vrpn_Button_NI_DIO24.h \
vrpn_CHProducts_Controller_Raw.h \
vrpn_CerealBox.h \
vrpn_Contour.h \
vrpn_DreamCheeky.h \
vrpn_Dyna.h \
vrpn_Event.h \
vrpn_Event_Analog.h \
vrpn_Event_Mouse.h \
vrpn_Flock.h \
vrpn_Flock_Parallel.h \
vrpn_ForceDeviceServer.h \
vrpn_Freespace.h \
vrpn_Futaba.C \
vrpn_GlobalHapticsOrb.h \
vrpn_Griffin.h \
vrpn_HumanInterface.h \
vrpn_IDEA.h \
vrpn_Imager_Stream_Buffer.h \
vrpn_ImmersionBox.h \
vrpn_JoyFly.h \
vrpn_Joylin.h \
vrpn_Keyboard.h \
vrpn_Laputa.h \
vrpn_LUDL.h \
vrpn_Logitech_Controller_Raw.h \
vrpn_Magellan.h \
vrpn_Microsoft_Controller_Raw.h \
vrpn_Mouse.h \
vrpn_NationalInstruments.h \
vrpn_nVidia_shield_controller.h \
vrpn_Oculus.h \
vrpn_OmegaTemperature.h \
vrpn_OneEuroFilter.h \
vrpn_Poser_Analog.h \
vrpn_Poser_Tek4662.h \
vrpn_Retrolink.h \
vrpn_Saitek_Controller_Raw.h \
vrpn_Spaceball.h \
vrpn_Streaming_Arduino.h \
vrpn_Tng3.h \
vrpn_Tracker_3DMouse.h \
vrpn_Tracker_AnalogFly.h \
vrpn_Tracker_ButtonFly.h \
vrpn_Tracker_Crossbow.h \
vrpn_Tracker_DTrack.h \
vrpn_Tracker_Fastrak.h \
vrpn_Tracker_Filter.h \
vrpn_Tracker_GPS.h \
vrpn_Tracker_GameTrak.h \
vrpn_Tracker_IMU.h \
vrpn_Tracker_Isotrak.h \
vrpn_Tracker_Liberty.h \
vrpn_Tracker_LibertyHS.h \
vrpn_Tracker_MotionNode.h \
vrpn_Tracker_NDI_Polaris.h \
vrpn_Tracker_NovintFalcon.h \
vrpn_Tracker_OSVRHackerDevKit.h \
vrpn_Tracker_PDI.h \
vrpn_Tracker_PhaseSpace.h \
vrpn_Tracker_RazerHydra.h \
vrpn_Tracker_SpacePoint.h \
vrpn_Tracker_TrivisioColibri.h \
vrpn_Tracker_ViewPoint.h \
vrpn_Tracker_WiimoteHead.h \
vrpn_Tracker_Wintracker.h \
vrpn_Tracker_isense.h \
vrpn_UNC_Joystick.h \
vrpn_Vality.h \
vrpn_VPJoystick.h \
vrpn_Wanda.h \
vrpn_WiiMote.h \
vrpn_Xkeys.h \
vrpn_YEI_3Space.h \
vrpn_Zaber.h \
vrpn_inertiamouse.h \
vrpn_nikon_controls.h \
vrpn_raw_sgibox.h \
vrpn_sgibox.h \
ifeq ($(HW_OS), pc_linux64)
SLIB_FILES += vrpn_DevInput.C
SLIB_INCLUDES += vrpn_DevInput.h
endif
ifeq ($(HW_OS), pc_linux)
SLIB_FILES += vrpn_DevInput.C
SLIB_INCLUDES += vrpn_DevInput.h
endif
# $(SLIB_OBJECTS):
$(OBJECT_DIR)/libvrpnserver.a: $(MAKEFILE) $(SLIB_OBJECTS)
$(AR) $(OBJECT_DIR)/libvrpnserver.a $(SLIB_OBJECTS)
-$(RANLIB) $(OBJECT_DIR)/libvrpnserver.a
# atmellib files.
ALIB_FILES = \
atmellib/vrpn_atmellib_helper.C \
atmellib/vrpn_atmellib_iobasic.C \
atmellib/vrpn_atmellib_openclose.C \
atmellib/vrpn_atmellib_register.C \
atmellib/vrpn_atmellib_tester.C
ALIB_OBJECTS = $(patsubst %,$(AOBJECT_DIR)/../%,$(ALIB_FILES:.C=.o))
ALIB_INCLUDES = \
vrpn_atmellib.h \
vrpn_atmellib_helper.h \
vrpn_atmellib_errno.h
$(ALIB_OBJECTS):
$(OBJECT_DIR)/libvrpnatmel.a: $(MAKEFILE) $(ALIB_OBJECTS)
$(AR) $(OBJECT_DIR)/libvrpnatmel.a $(ALIB_OBJECTS)
-$(RANLIB) $(OBJECT_DIR)/libvrpnatmel.a
# gpsnmealib files.
GLIB_FILES = \
gpsnmealib/latLonCoord.C \
gpsnmealib/nmeaParser.C \
gpsnmealib/typedCoord.C \
gpsnmealib/utmCoord.C
GLIB_OBJECTS = $(patsubst %,$(GOBJECT_DIR)/../%,$(GLIB_FILES:.C=.o))
GLIB_INCLUDES = \
latLonCoord.h \
nmeaParser.h \
typeCoord.h \
utmCoord.h
$(GLIB_OBJECTS):
$(OBJECT_DIR)/libvrpngpsnmea.a: $(MAKEFILE) $(GLIB_OBJECTS)
$(AR) $(OBJECT_DIR)/libvrpngpsnmea.a $(GLIB_OBJECTS)
-$(RANLIB) $(OBJECT_DIR)/libvrpngpsnmea.a
#############################################################################
#
# other stuff
#
#############################################################################
.PHONY: clean
clean:
ifeq ($(HW_OS),)
echo "Must specify HW_OS !"
else
$(RMF) $(LIB_OBJECTS) $(OBJECT_DIR)/libvrpn.a \
$(OBJECT_DIR)/libvrpn_g++.a \
$(SLIB_OBJECTS) \
$(ALIB_OBJECTS) \
$(GLIB_OBJECTS) \
$(OBJECT_DIR)/libvrpnserver.a \
$(OBJECT_DIR)/libvrpnatmel.a \
$(OBJECT_DIR)/libvrpngpsnmea.a \
$(OBJECT_DIR)/libvrpnserver_g++.a \
$(OBJECT_DIR)/.depend \
$(OBJECT_DIR)/.depend-old
ifneq (xxx$(FORCE_GPP),xxx1)
@echo -----------------------------------------------------------------
@echo -- Wart: type \"$(MAKE) clean_g++\" to clean up after g++
@echo -- I don\'t do it automatically in case you don\'t have g++
@echo -----------------------------------------------------------------
endif
#ifneq ($(CC), g++)
# $(MAKE) FORCE_GPP=1 clean
#endif
endif
.PHONY: clean
clean_g++:
$(MAKE) FORCE_GPP=1 clean
# clobberall removes the object directory for EVERY architecture.
# One problem - the object directory for pc_win32 also contains files
# that must be saved.
# clobberall also axes left-over CVS cache files.
.PHONY: clobberall
clobberall: clobberwin32
$(RMF) -r $(SAFE_KNOWN_ARCHITECTURES)
$(RMF) -r $(CLIENT_SKA)
$(RMF) -r $(SERVER_SKA)
$(RMF) .#* server_src/.#* client_src/.#*
.PHONY: clobberwin32
clobberwin32:
$(RMF) -r pc_win32/DEBUG/*
$(RMF) -r pc_win32/vrpn/Debug/*
$(RMF) -r client_src/pc_win32/printvals/Debug/*
$(RMF) -r server_src/pc_win32/vrpn_server/Debug/*
install: all
-mkdir -p $(LIB_DIR)
( cd $(LIB_DIR) ; rm -f libvrpn*.a )
( cd $(OBJECT_DIR) ; cp *.a $(LIB_DIR) )
-mkdir -p $(INCLUDE_DIR)
cp vrpn*.h $(INCLUDE_DIR)
uninstall:
( cd $(LIB_DIR) ; rm -f libvrpn*.a )
( cd $(INCLUDE_DIR) ; rm -f vrpn*.h )
#############################################################################
#
# Dependencies
#
# If it doesn't already exist, this makefile automatically creates
# a dependency file called .depend. Then it includes it so that
# the build will know the dependency information.
#
# to recreate a dependencies file, type "make depend"
# do this any time you add a file to the project,
# or add/remove #include lines from a source file
#
# if you are on an SGI and want g++ to make the dependency file,
# then type: gmake CC=g++ depend
#
# if you don't want a dependency file, then remove .depend if it exists,
# and type "touch .depend". if it exists (and is empty), make will not
# automatically create it or automatically update it (unless you type
# make depend)
#
###############
### this way works better
### you type "make depend" anytime you add a file or
### add/remove #includes from a file
########
include $(OBJECT_DIR)/.depend
.PHONY: depend
depend:
-$(MVF) $(OBJECT_DIR)/.depend $(OBJECT_DIR)/.depend-old
$(MAKE) $(OBJECT_DIR)/.depend
$(OBJECT_DIR)/.depend:
@echo ----------------------------------------------------------------
@echo -- Making dependency file. If you add files to the makefile,
@echo -- or add/remove includes from a .h or .C file, then you should
@echo -- remake the dependency file by typing \"$(MAKE) depend\"
@echo ----------------------------------------------------------------
-mkdir -p $(OBJECT_DIR)
ifeq ($(HW_OS),hp700_hpux10)
@echo -- $(HW_OS): Using g++ since HP CC does not understand -M
@echo -- if this causes an error, then delete .depend and type
@echo -- \"touch .depend\" to create an empty file
@echo ----------------------------------------------------------------
$(SHELL) -ec 'g++ -MM $(ALL_CXXFLAGS) $(LIB_FILES) \
| sed '\''s/\(.*\.o[ ]*:[ ]*\)/$(OBJECT_DIR)\/\1/g'\'' > $(OBJECT_DIR)/.depend'
else
ifeq ($(HW_OS),hp_flow_aCC)
@echo -- $(HW_OS): Using g++ since HP aCC does not understand -M