-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathmySTEP.make
executable file
·1635 lines (1487 loc) · 68.3 KB
/
mySTEP.make
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
#!/usr/bin/make -f
#
# FIXME: the current directory must be the one that contains the .qcodeproj
#
# easy call: DEPLOY=true RUN=true DEBIAN_RELEASES=stretch DEBIAN_ARCHITECTURES=armhf ./AppKit.qcodeproj
#
ifeq (nil,null) ## this is to allow for the following text without special comment character considerations
#
# This file is part of mySTEP
#
# You should not edit this file as it affects all projects you will compile!
#
# Copyright, H. Nikolaus Schaller <hns@computer.org>, 2003-2021
# This document is licenced using LGPL
#
# Requires Xcode 3.2 or later
# and XQuartz incl. X11 SDK
#
# To use this makefile in Xcode with Xtoolchain:
#
# 1. create a project.qcodeproj file
# 2. open through QuantumCode and edit the project definitions
# 3. open the Xcode project
# 4. select the intended target in the Targets group
# 5. select from the menu Build/New Build Phase/New Shell Script Build Phase
# 6. select the "Shell Script Files" phase in the target
# 7. open the information (i) or (Apple-I)
# 8. add the following code into the "Script" area
# cd path-to qcodeproj; ./project.qcodeproj
# 9. Build the project (either in deployment or development mode)
#
# environment Variable dependencies
# Entries marked with * should be defined in the .qcodeproj
# Entries marked with + should be defined by the caller of the .qcodeproj
# Entries with () are optional
# Entries with - should not be set
#
# general setup
# (*) QuantumSTEP - root of QuantumSTEP - default: /usr/local/QuantumSTEP
# (-) QUIET - optional prefix "@" to make some commands quiet
QUIET=@
# sources (input)
# * SOURCES
# (*) INCLUDES
# (*) CFLAGS
# (+) PROFILING - default: no
# (*) FRAMEWORKS
# (*) LIBS
# compile control
# (+) NOCOMPILE - default: no
# (+) BUILT_PRODUCTS_DIR - default: build/Deployment
# (+) TARGET_BUILD_DIR - default: build/Deployment
# (+) PHPONLY - build only PHP ("true", "no") - default: no
# (+) RECURSIVE - build subprojects first ("true", "no") - default: no
# (+) BUILD_FOR_DEPLOYMENT - default: no
# (+) OPTIMIZE - optimize level - default: s
# (+) INSPECT - save .i and .S intermediate steps - default: no
# (+) BUILD_STYLE - default: ?
# (+) GCC_OPTIMIZATION_LEVEL - default: 0
# (+) BUILD_DOCUMENTATION - default: no
# (+) DEBIAN_ARCHITECTURES - default: macos armel armhf arm64 i386 mipsel
# (-) DEBIAN_ARCH - used internally
# (+) DEBIAN_RELEASES - default: all releases defined by depends - or staging
# (+) DEBIAN_RELEASE - used internally the release to build for (modifies compiler, libs and staging for result)- default: staging
# bundle definitions (output)
# * PROJECT_NAME
# (*) PRODUCT_NAME - the product name (if "All", then PROJECT_NAME is taken)
# (*) PRODUCT_BUNDLE_IDENTIFIER
# * WRAPPER_EXTENSION
# (*) FRAMEWORK_VERSION - default: A
# (*) CURRENT_PROJECT_VERSION - default: 1.0.0
# - EXECUTABLE_NAME - (if "All", then PRODUCT_NAME is taken)
# - TRIPLE - the architecture triple to use
# Debian packaging (postprocess 1)
# * DEBIAN_PACKAGE_NAME - default: quantumstep-$PRODUCT_NAME-$WRAPPER-extension (note: _ are converted to -)
# - DEBIAN_PACKAGE_VERSION - defult: current date/time
# (+) DEBDIST - where to store the binary-arch files - default: $QuantumSTEP/System/Installation/Debian/dists
# (*) DEBIAN_DEPENDS - e.g. quantumstep-cocoa-framework
# (*) DEBIAN_RECOMMENDS - e.g. quantumstep-cocoa-framework
# (*) DEBIAN_CONFLICTS -
# (*) DEBIAN_REPLACES - e.g. linux-libc-dev
# (*) DEBIAN_PROVIDES -
# (*) DEBIAN_HOMEPAGE - www.quantum-step.com
# (*) DEBIAN_DESCRIPTION - a description text
# (*) DEBIAN_MAINTAINER
# (*) DEBIAN_SECTION - e.g. x11
# (*) DEBIAN_PRIORITY - e.g. optional
# (*) DEBIAN_NOPACKAGE - don't build packages
# (*) FILES - more files to include (e.g. binaries) relative to INSTALL_PATH (deprecated)
# (*) DATA - more files to include (e.g. binaries) relative to root (deprecated)
# (*) DEBIAN_RAW_FILES - additional files/directories to be included in debian package
# (*) DEBIAN_RAW_PREFIX - path prefixed to DEBIAN_RAW_FILES before packing (may be ./) - default:
# (*) DEBIAN_RAW_SUBDIR - Subdir within sources where we find the raw files - default:
# (+) OPEN_DEBIAN - if true, open .deb through DebianViewer
# download and test (postprocess 2)
# * INSTALL_PATH - install path for compiled SOURCES relative to $QuantumSTEP (or absolute if it starts with //) - default empty
# - INSTALL
# (+) EMBEDDED_ROOT - root on embedded device (default /usr/local/QuantumSTEP)
# (+) DEPLOY - true/false default: false
# (+) DEVICE - filter for device to deploy default: "" (meaning all reachable devices)
# (+) RUN - true/false default: false
# (+) RUN_CMD - default: run
#
# targets
# build: build everything (outer level)
# build_deb: called recursively to build for a specific debian architecture
# clean: clears build directory (not for subprojects)
# debug: print all variable
endif
# makefile debug hack https://www.cmcrossroads.com/article/tracing-rule-execution-gnu-make
ifeq (yes,no)
OLD_SHELL := $(SHELL)
SHELL = $(warning Building $@)$(OLD_SHELL)
endif
# don't compile for MacOS (but copy/install) if called as build script phase from within Xcode
ifneq ($(XCODE_VERSION_ACTUAL),)
NOCOMPILE:=true
endif
ifeq ($(QuantumSTEP),)
QuantumSTEP:=/usr/local/QuantumSTEP
endif
ifeq ($(EMBEDDED_ROOT),)
EMBEDDED_ROOT:=$(QuantumSTEP)
endif
ifeq ($(INSTALL),)
INSTALL:=true
endif
HOST_INSTALL_PATH := $(shell realpath $(QuantumSTEP)/$(INSTALL_PATH) || echo $(QuantumSTEP)/$(INSTALL_PATH))
# prefix by $EMBEDDED_ROOT unless $INSTALL_PATH is starting with //
ifneq ($(findstring //,$(INSTALL_PATH)),//)
TARGET_INSTALL_PATH := $(EMBEDDED_ROOT)/$(INSTALL_PATH)
else
TARGET_INSTALL_PATH := $(INSTALL_PATH)
# don't install on localhost
INSTALL=false
endif
PHP=$(shell which php)
.PHONY: clean debug build prepare_temp_files build_deb build_architectures build_subprojects build_doxy make_sh install_local deploy_remote launch_remote bundle headers resources
# configure Embedded System if undefined
ROOT:=$(QuantumSTEP)
### FIXME: what is the right path???
# FIXME: this does only work on the Mac! On embedded the qsrsh is in /usr/bin/$HOST_ARCH or $PATH
DOWNLOAD_TOOL := $(QuantumSTEP)/usr/bin/qsrsh
XHOST_TOOL := /opt/X11/bin/xhost
# tools
ifeq ($(shell uname),Darwin)
# use platform specific (cross-)compiler on Darwin host
DOXYGEN := /Applications/Doxygen.app/Contents/Resources/doxygen
# disable special MacOS X stuff for tar
TAR := COPY_EXTENDED_ATTRIBUTES_DISABLED=true COPYFILE_DISABLE=true /opt/local/bin/gnutar
# we want tar to save root:root and not 0:0 (translated on MacOS)
ROOT=root
ifeq ($(PRODUCT_NAME),All)
# Xcode aggregate target
PRODUCT_NAME=$(PROJECT_NAME)
endif
ifeq ($(PRODUCT_BUNDLE_IDENTIFIER),)
PRODUCT_BUNDLE_IDENTIFIER=org.quantumstep.$(PRODUCT_NAME)
endif
ifeq ($(TRIPLE),php)
# besser: php -l & copy
CC := : $(PHP) -l + copy
# besser: makephar - (shell-funktion?)
LD := : makephar
AS := :
NM := :
STRIP := :
SO := phar
PHAR := $(shell which phar)
else ifeq ($(TRIPLE),MacOS)
DEFINES += -D__mySTEP__
INCLUDES += -I/opt/local/include -I/opt/local/include/X11 -I/opt/local/include/freetype2 -I/Applications/Xcode.app//Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/
LIBS += -L/opt/local/lib
TOOLCHAIN=/usr/bin
CC := MACOSX_DEPLOYMENT_TARGET=10.6 $(TOOLCHAIN)/gcc
LD := $(CC)
AS := $(TOOLCHAIN)/as
NM := $(TOOLCHAIN)/nm
STRIP := $(TOOLCHAIN)/strip -u
SO := dylib
else # Linux
DEFINES += -D__mySTEP__
# use specific toolchain depending on DEBIAN_RELEASE (wheezy, jessie, stretch, buster, bullseye, ...) and DEBIAN_ARCH (arm64, armhf, mipsel, ...)
# otherwise take a default compiler/toolchain we use for "universal" apps/bundles
TOOLCHAIN_FALLBACK = 8-Jessie
DEBIAN_RELEASE_FALLBACK = jessie
DEBIAN_RELEASE_TRANSLATED=${shell case "$(DEBIAN_RELEASE)" in \
( etch ) echo "4-Etch";; \
( lenny ) echo "5-Lenny";; \
( squeeze ) echo "6-Squeeze";; \
( wheezy ) echo "7-Wheezy";; \
( jessie ) echo "8-Jessie";; \
( stretch ) echo "9-Stretch";; \
( buster ) echo "10-Buster";; \
( bullseye ) echo "11-Bullseye";; \
( bookworm ) echo "12-Bookworm";; \
( trixie ) echo "13-Trixie";; \
( forky ) echo "14-Forky";; \
( * ) echo "$(TOOLCHAIN_FALLBACK)";; \
esac;}
# FIXME: should check if toolchain is installed...
TOOLCHAIN := $(QuantumSTEP)/System/Library/Frameworks/System.framework/Versions/Current/$(DEBIAN_RELEASE_TRANSLATED)/$(DEBIAN_ARCH)/usr
CC := LANG=C $(TOOLCHAIN)/bin/$(TRIPLE)-gcc
# CC := clang -march=armv7-a -mfloat-abi=soft -ccc-host-triple $(TRIPLE) -integrated-as --sysroot $(QuantumSTEP) -I$(QuantumSTEP)/include
LD := $(CC) -v -L$(TOOLCHAIN)/$(TRIPLE)/lib -Wl,-rpath-link,$(TOOLCHAIN)/$(TRIPLE)/lib -Wl,-rpath-link,$(TOOLCHAIN)/$(TRIPLE)/lib64
AS := $(TOOLCHAIN)/bin/$(TRIPLE)-as
NM := $(TOOLCHAIN)/bin/$(TRIPLE)-nm
STRIP := $(TOOLCHAIN)/bin/$(TRIPLE)-strip
SO := so
endif
else # Darwin
# native compile on target machine
DOXYGEN := doxygen
TAR := tar
## FIXME: allow to cross-compile
TOOLCHAIN := native
INCLUDES += -I/usr/include/freetype2
CC := $(TRIPLE)-gcc
LD := $(CC) -v
AS := $(TRIPLE)-as
NM := $(TRIPLE)-nm
STRIP := $(TRIPLE)-strip
SO := so
endif
# if we call the makefile not within Xcode
ifeq ($(BUILT_PRODUCTS_DIR),)
BUILT_PRODUCTS_DIR=build/Deployment
endif
ifeq ($(TARGET_BUILD_DIR),)
TARGET_BUILD_DIR=build/Deployment
endif
ifeq ($(DEBIAN_RELEASE),none)
TTT=$(TARGET_BUILD_DIR)/$(TRIPLE)/
else
TTT=$(TARGET_BUILD_DIR)/$(DEBIAN_RELEASE)/$(TRIPLE)/
endif
# define CONTENTS subdirectory as expected by the Foundation library
ifeq ($(EXECUTABLE_NAME),All)
EXECUTABLE_NAME=$(PRODUCT_NAME)
endif
ifeq ($(EXECUTABLE_NAME),)
EXECUTABLE_NAME=$(PRODUCT_NAME)
endif
ifeq ($(TRIPLE),MacOS)
else
LDFLAGS := $(LDFLAGS) -Wl,--copy-dt-needed-entries
endif
BINARY=
ifeq ($(WRAPPER_EXTENSION),) # command line tool
CONTENTS=.
# shared between all binary tools
NAME_EXT=bin
# this keeps the binaries separated for installation/packaging
PKG=$(BUILT_PRODUCTS_DIR)/$(PRODUCT_NAME).bin
EXEC=$(PKG)/$(NAME_EXT)/$(TRIPLE)
ifeq ($(DEBIAN_RELEASE),none)
BINARY=$(EXEC)/$(PRODUCT_NAME)
else ifeq ($(DEBIAN_RELEASE),staging) # generic command line tool
BINARY=$(EXEC)/$(PRODUCT_NAME)
else # release specific
BINARY=$(EXEC)/$(PRODUCT_NAME)-$(DEBIAN_RELEASE)
endif # ($(DEBIAN_RELEASE),none)
# architecture specific version (only if it does not yet have the prefix)
ifneq (,$(findstring ///System/Library/Frameworks/System.framework/Versions/$(TRIPLE),//$(INSTALL_PATH)))
INSTALL_PATH := /System/Library/Frameworks/System.framework/Versions/$(TRIPLE)$(INSTALL_PATH)
endif
endif # ($(WRAPPER_EXTENSION),) # command line tool
ifeq ($(WRAPPER_EXTENSION),framework) # framework
ifeq ($(FRAMEWORK_VERSION),) # empty
# default to A
FRAMEWORK_VERSION=A
endif
ifeq ($(CURRENT_PROJECT_VERSION),) # empty
# default to 1.0.0
CURRENT_PROJECT_VERSION=1.0.0
endif
CONTENTS=Versions/Current
NAME_EXT=$(PRODUCT_NAME).$(WRAPPER_EXTENSION)
PKG=$(BUILT_PRODUCTS_DIR)
EXEC=$(PKG)/$(NAME_EXT)/$(CONTENTS)/$(TRIPLE)
ifeq ($(TRIPLE),MacOS) # directly on CONTENTS level
BINARY=$(PKG)/$(NAME_EXT)/$(CONTENTS)/$(EXECUTABLE_NAME)
else ifeq ($(DEBIAN_RELEASE),none)
BINARY=$(EXEC)/lib$(EXECUTABLE_NAME).$(SO)
else ifeq ($(DEBIAN_RELEASE),staging) # generic command line tool
# no short name since we will symlink to it when building debian packages
BINARY=$(EXEC)/lib$(EXECUTABLE_NAME)-$(DEBIAN_RELEASE).$(SO)
else # release specific
BINARY=$(EXEC)/lib$(EXECUTABLE_NAME)-$(DEBIAN_RELEASE).$(SO)
endif # setting BINARY
# HEADERS=$(EXEC)/Headers/$(PRODUCT_NAME)
STDCFLAGS := -I$(EXEC)/../Headers/ $(STDCFLAGS)
ifeq ($(TRIPLE),MacOS)
LDFLAGS := -dynamiclib -install_name $(HOST_INSTALL_PATH)/$(NAME_EXT)/Versions/Current/$(PRODUCT_NAME) -undefined dynamic_lookup $(LDFLAGS)
else
LDFLAGS := -shared -Wl,-soname,$(PRODUCT_NAME) $(LDFLAGS)
endif # ($(TRIPLE),MacOS)
endif # ($(WRAPPER_EXTENSION),framework) # framework
ifeq ($(BINARY),) # not yet defined
CONTENTS=Contents
NAME_EXT=$(PRODUCT_NAME).$(WRAPPER_EXTENSION)
PKG=$(BUILT_PRODUCTS_DIR)
EXEC=$(PKG)/$(NAME_EXT)/$(CONTENTS)/$(TRIPLE)
ifeq ($(TRIPLE),MacOS)
BINARY=$(EXEC)/$(EXECUTABLE_NAME)
else ifeq ($(DEBIAN_RELEASE),staging) # generic app or command line tool
BINARY=$(EXEC)/$(EXECUTABLE_NAME)
else # release specific
BINARY=$(EXEC)/$(EXECUTABLE_NAME)-$(DEBIAN_RELEASE)
endif # ($(TRIPLE),MacOS)
ifeq ($(WRAPPER_EXTENSION),app)
# STDCFLAGS := -DFAKE_MAIN $(STDCFLAGS) # application
else # not an app
ifeq ($(TRIPLE),MacOS)
LDFLAGS := -dynamiclib -install_name @rpath/$(NAME_EXT)/Versions/Current/MacOS/$(PRODUCT_NAME) -undefined dynamic_lookup $(LDFLAGS)
else
LDFLAGS := -shared -Wl,-soname,$(NAME_EXT) $(LDFLAGS) # any other bundle
endif # LDFLAGS
endif # not an app
endif # ($(BINARY),) # not yet defined
ifeq ($(BINARY),) # still not defined - use default
BINARY=$(EXEC)/$(EXECUTABLE_NAME)
endif
# expand patterns in SOURCES (feature is not used by QuantumCode)
XSOURCES := $(wildcard $(SOURCES))
# get the objects from all sources we need to compile and link
OBJCSRCS := $(filter %.m %.mm,$(XSOURCES))
CSRCS := $(filter %.c %.cpp %.c++,$(XSOURCES))
LEXSRCS := $(filter %.l %.lm,$(XSOURCES))
YACCSRCS := $(filter %.y %.ym,$(XSOURCES))
# FIXME: we have no rules yet how to process LEXSRCS and YACCSRCS
# sources that drive the compiler
# FIXME: include LEX/YACC?
SRCOBJECTS := $(OBJCSRCS) $(CSRCS)
OBJECTS := $(SRCOBJECTS:%.m=$(TTT)+%.o)
OBJECTS := $(OBJECTS:%.mm=$(TTT)+%.o)
OBJECTS := $(OBJECTS:%.c=$(TTT)+%.o)
OBJECTS := $(OBJECTS:%.cpp=$(TTT)+%.o)
OBJECTS := $(OBJECTS:%.c++=$(TTT)+%.o)
# PHP and shell scripts
PHPSRCS := $(filter %.php,$(XSOURCES))
# could use OBJECTS and ifeq ($(TRIPLE),php)
PHPOBJECTS := $(PHPSRCS:%.php=$(TTT)+%.o)
SHSRCS := $(filter %.sh,$(XSOURCES))
# Info.plist
INFOPLISTS := $(filter Info.plist Info%.plist %Info.plist %Info%.plist,$(XSOURCES))
# Entitlements
ENTITLEMENTS := $(filter %.entitlements,$(XSOURCES))
ifeq ($(strip $(ENTITLEMENTS)),)
ENTITLEMENTS := /tmp/mySTEP-default.entitlements
endif
# Assets
ASSETS := $(filter %.xcassets,$(XSOURCES))
# subprojects
SUBPROJECTS := $(filter %.qcodeproj,$(XSOURCES))
# header files
HEADERSRC := $(filter %.h %.pch,$(XSOURCES))
# additional debian control files
DEBIAN_CONTROL := $(filter %.preinst %.postinst %.prerm %.postrm %.conffiles,$(XSOURCES))
# all sources that are processed specially
PROCESSEDSRC := $(SRCOBJECTS) $(PHPSRCS) $(SHSRCS) $(INFOPLISTS) $(HEADERSRC) $(SUBPROJECTS) $(ENTITLEMENTS) $(ASSETS)
# all remaining selected (re)sources
RESOURCES := $(filter-out $(PROCESSEDSRC),$(XSOURCES))
# default is to build for all
ifeq ($(BASE_OS_LIST),)
ifneq ($(XCODE_VERSION_ACTUAL),)
BASE_OS_LIST=Debian
else
# BASE_OS_LIST=MacOS Debian
BASE_OS_LIST=Debian
endif
endif # ifeq ($(BASE_OS_LIST),)
#unless PHPONLY
ifeq ($(PHPONLY),true)
BASE_OS_LIST=
endif
ifneq ($(strip $(PHPSRCS)),) # if any PHP source defined
BASE_OS_LIST+=php
endif
ifeq ($(DEBIAN_ARCHITECTURES),)
DEBIAN_ARCHITECTURES=macos armel armhf arm64 i386 mipsel
# ifeq ($(RUN),true)
# take only the arch of the "run device"
endif
# recursively make for all architectures $(DEBIAN_ARCHITECTURES) and RELEASES as defined in DEBIAN_DEPENDS
ifeq ($(DEBIAN_RELEASES),)
DEBIAN_RELEASES=$(shell echo "$(DEBIAN_DEPENDS)" "$(DEBIAN_RECOMMENDS) $(DEBIAN_CONFLICTS) $(DEBIAN_REPLACES) $(DEBIAN_PROVIDES)" | tr ',' '\n' | fgrep ':' | sed 's/ *\(.*\):.*/\1/g' | sort -u)
endif
ifeq ($(DEBIAN_RELEASES),)
DEBIAN_RELEASES="staging"
endif
# this is the default/main target on the outer level
ifeq ($(NOCOMPILE),true)
build: build_subprojects build_doxy build_architectures install_local
else
build: build_subprojects build_doxy build_architectures deploy_remote launch_remote
endif
@echo build done for: $(DEBIAN_ARCHITECTURES)
@date
clean:
ifeq ($(RECURSIVE),true)
# SUBPROJECTS: $(SUBPROJECTS)
# RECURSIVE: $(RECURSIVE)
ifneq "$(strip $(SUBPROJECTS))" ""
@for SUBPROJECT in $(SUBPROJECTS); \
do \
( \
unset TRIPLE PRODUCT_NAME DEBIAN_DEPENDS DEBIAN_RECOMMENDS DEBIAN_DESCRIPTION DEBIAN_PACKAGE_NAME \
FRAMEWORKS FMWKS INCLUDES LIBS INSTALL_PATH PRODUCT_NAME SOURCES WRAPPER_EXTENSION FRAMEWORK_VERSION; \
export RECURSIVE; \
cd $$(dirname $$SUBPROJECT) && echo Entering directory $$(pwd) for $$SUBPROJECT && ACTION=clean ./$$(basename $$SUBPROJECT) || break ; \
echo Leaving directory $$(pwd); \
); \
done
endif
endif
@[ -d build ] && chmod -Rf u+w build || true # rm -rf refuses to delete files without write mode
@rm -rf build
@echo CLEAN done.
debug: # see http://www.oreilly.com/openbook/make3/book/ch12.pdf
$(for v,$(V), \
$(warning $v = $($v)))
###
### copy/install $DATA and $FILES and $DEBIAN_RAW_FILES $DEBIAN_RAW_PATH $DEBIAN_RAW_SUBDIR
### build_deb (only)
### architecture all-packages are part of machine specific Packages.gz (!)
### there is not necessarily a special binary-all directory but we can do that
### FIXME: directly use the DEBIAN_ARCH names for everything
build_architectures:
# build_architectures
@echo build_architectures
ifneq ($(DEBIAN_ARCHITECTURES),none)
ifneq ($(DEBIAN_ARCHITECTURES),)
# ifeq ($(RUN),true)
# take only the release of the RUN device
echo DEBIAN_RELEASES: $(DEBIAN_RELEASES); \
for BASE_OS in $(BASE_OS_LIST); do \
if [ "$$BASE_OS" = "Debian" ]; then \
for DEBIAN_RELEASE in $(DEBIAN_RELEASES); do \
for DEBIAN_ARCH in $(DEBIAN_ARCHITECTURES); do \
EXIT=1; \
case "$$DEBIAN_ARCH" in \
armel ) export TRIPLE=arm-linux-gnueabi;; \
armhf ) export TRIPLE=arm-linux-gnueabihf;; \
arm64 ) export TRIPLE=aarch64-linux-gnu;; \
i386 ) export TRIPLE=i486-linux-gnu;; \
amd64 ) export TRIPLE=x86_64-linux-gnu;; \
mipsel ) export TRIPLE=mipsel-linux-gnu;; \
macos ) export TRIPLE=MacOS;; \
*-*-* ) export TRIPLE="$$DEBIAN_ARCH";; \
* ) export TRIPLE=unknown-linux-gnu;; \
esac; \
echo "*** building for $$DEBIAN_RELEASE / $$DEBIAN_ARCH using $$TRIPLE ***"; \
export DEBIAN_RELEASE="$$DEBIAN_RELEASE"; \
export DEBIAN_ARCH="$$DEBIAN_ARCH"; \
export TRIPLE="$$TRIPLE"; \
$(QUIET)make -f $(QuantumSTEP)/System/Sources/Frameworks/mySTEP.make build_deb; \
echo "$$DEBIAN_ARCH" done; \
done ;\
echo "$$DEBIAN_RELEASE" done; \
done; \
else \
export DEBIAN_RELEASE="none"; \
export DEBIAN_ARCH="none"; \
export TRIPLE=$$BASE_OS; \
EXIT=0; \
echo "*** building for $$BASE_OS ***"; \
$(QUIET)make -f $(QuantumSTEP)/System/Sources/Frameworks/mySTEP.make build_deb; \
echo "$$BASE_OS" done; \
fi; \
$(QUIET)make -f $(QuantumSTEP)/System/Sources/Frameworks/mySTEP.make make_sh install_local; \
done
endif
endif
@echo build_architectures done for $(DEBIAN_ARCHITECTURES)
__dummy__:
# dummy target to allow for comments while setting more make variables
ifeq ($(RUN_CMD),)
# override if (stripped) package is built using xcodebuild
RUN_CMD := run
endif
# add default frameworks (unless we build the default frameworks and they are not specified)
ifneq ($(PRODUCT_NAME).$(WRAPPER_EXTENSION),Foundation.framework)
ifneq ($(PRODUCT_NAME).$(WRAPPER_EXTENSION),AppKit.framework)
ifneq ($(PRODUCT_NAME).$(WRAPPER_EXTENSION),CoreData.framework)
ifneq ($(PRODUCT_NAME).$(WRAPPER_EXTENSION),Cocoa.framework)
ifeq ($(filter Cocoa,$(FRAMEWORKS)),)
FRAMEWORKS := Cocoa $(FRAMEWORKS)
endif
ifeq ($(filter CoreData,$(FRAMEWORKS)),)
FRAMEWORKS := CoreData $(FRAMEWORKS)
endif
ifeq ($(filter AppKit,$(FRAMEWORKS)),)
FRAMEWORKS := AppKit $(FRAMEWORKS)
endif
ifeq ($(filter Foundation,$(FRAMEWORKS)),)
FRAMEWORKS := Foundation $(FRAMEWORKS)
endif
endif
endif
endif
endif
ifneq ($(TRIPLE),MacOS)
INCLUDES += -I$(TOOLCHAIN)/$(TRIPLE)/include/freetype2
endif
#ifeq ($(TRIPLE),MacOS)
#LNK :=
#else
LNK := .link
#endif
# allow to use #import <framework/header.h> while building the framework
ifeq ($(WRAPPER_EXTENSION),framework)
INCLUDES := -I$(PKG)/$(NAME_EXT)/$(CONTENTS)/Headers$(LNK) $(INCLUDES)
endif
INCLUDES := -I$(TTT) $(INCLUDES)
ifneq ($(strip $(OBJCSRCS)),) # any objective C source
ifeq ($(TRIPLE),MacOS)
# check if each framework exists in /System/Library/*Frameworks or explicitly include/link from $(QuantumSTEP)
### FIXME: why do we need this? MacOS only...
### MacOS should use -F and the framework path!
### FIXME: list of locations should be a default list which can be extended by project settings!
FMWK_PATHS := /System/Library/Frameworks $(QuantumSTEP)/Library/Frameworks $(QuantumSTEP)/System/Library/Frameworks $(QuantumSTEP)/System/Library/PrivateFrameworks $(QuantumSTEP)/Developer/Library/Frameworks
### FIXME: generate automatically from FMWK_PATHS
INCLUDES := $(INCLUDES) $(shell for FMWK in CoreFoundation $(FRAMEWORKS); \
do \
if [ -d "/System/Library/Frameworks/$${FMWK}.framework" ]; \
then :; \
elif [ -d "$(QuantumSTEP)/Library/Frameworks/$$FMWK.framework" ]; \
then echo "-I$(QuantumSTEP)/Library/Frameworks/$$FMWK.framework/Versions/Current/Headers$(LNK)"; \
elif [ -d "$(QuantumSTEP)/System/Library/Frameworks/$$FMWK.framework" ]; \
then echo "-I$(QuantumSTEP)/System/Library/Frameworks/$$FMWK.framework/Versions/Current/Headers$(LNK)"; \
elif [ -d "$(QuantumSTEP)/System/Library/PrivateFrameworks/$$FMWK.framework" ]; \
then echo "-I$(QuantumSTEP)/System/Library/PrivateFrameworks/$$FMWK.framework/Versions/Current/Headers$(LNK)"; \
elif [ -d "$(QuantumSTEP)/Developer/Library/Frameworks/$$FMWK.framework" ]; \
then echo "-I$(QuantumSTEP)/Developer/Library/Frameworks/$$FMWK.framework/Versions/Current/Headers$(LNK)"; \
else echo "-I$$FMWK.headers$(LNK)"; \
fi; done)
### FIXME: why do we need this? MacOS only...
LIBS := $(LIBS) $(shell for FMWK in CoreFoundation $(FRAMEWORKS); \
do \
if [ -d "/System/Library/Frameworks/$${FMWK}.framework" ]; \
then echo -framework "$$FMWK"; \
elif [ -d "$(QuantumSTEP)/Library/Frameworks/$$FMWK.framework" ]; \
then echo "$(QuantumSTEP)/Library/Frameworks/$$FMWK.framework/Versions/Current/$(TRIPLE)/lib$$FMWK.dylib"; \
elif [ -d "$(QuantumSTEP)/System/Library/Frameworks/$$FMWK.framework" ]; \
then echo "$(QuantumSTEP)/System/Library/Frameworks/$$FMWK.framework/Versions/Current/$(TRIPLE)/lib$$FMWK.dylib"; \
elif [ -d "$(QuantumSTEP)/System/Library/PrivateFrameworks/$$FMWK.framework" ]; \
then echo "$(QuantumSTEP)/System/Library/PrivateFrameworks/$$FMWK.framework/Versions/Current/$(TRIPLE)/lib$$FMWK.dylib"; \
elif [ -d "$(QuantumSTEP)/Developer/Library/Frameworks/$$FMWK.framework" ]; \
then echo "$(QuantumSTEP)/Developer/Library/Frameworks/$$FMWK.framework/Versions/Current/$(TRIPLE)/lib$$FMWK.dylib"; \
else echo "lib$$FMWK.dylib"; \
fi; done)
else
# look up headers and libs to link
INCLUDES := $(INCLUDES) $(shell for FMWK in $(FRAMEWORKS); \
do \
if [ -d "$(QuantumSTEP)/Library/Frameworks/$$FMWK.framework" ]; \
then echo "-I$(QuantumSTEP)/Library/Frameworks/$$FMWK.framework/Versions/Current/Headers$(LNK)"; \
elif [ -d "$(QuantumSTEP)/System/Library/Frameworks/$$FMWK.framework" ]; \
then echo "-I$(QuantumSTEP)/System/Library/Frameworks/$$FMWK.framework/Versions/Current/Headers$(LNK)"; \
elif [ -d "$(QuantumSTEP)/System/Library/PrivateFrameworks/$$FMWK.framework" ]; \
then echo "-I$(QuantumSTEP)/System/Library/PrivateFrameworks/$$FMWK.framework/Versions/Current/Headers$(LNK)"; \
elif [ -d "$(QuantumSTEP)/Developer/Library/Frameworks/$$FMWK.framework" ]; \
then echo "-I$(QuantumSTEP)/Developer/Library/Frameworks/$$FMWK.framework/Versions/Current/Headers$(LNK)"; \
else echo "-I$$FMWK$(LNK)"; \
fi; done)
### hier fehlt vermutlich noch der -rpath-link!
FMWKS := $(FMWKS) $(shell for FMWK in $(FRAMEWORKS); \
do \
for DIR in $(QuantumSTEP)/Library/Frameworks $(QuantumSTEP)/System/Library/Frameworks $(QuantumSTEP)/System/Library/PrivateFrameworks $(QuantumSTEP)/Developer/Library/Frameworks; \
do \
if [ -r $$DIR/$$FMWK.framework/Versions/Current/$(TRIPLE)/lib$$FMWK-$(DEBIAN_RELEASE).so ]; \
then echo $$DIR/$$FMWK.framework/Versions/Current/$(TRIPLE)/lib$$FMWK-$(DEBIAN_RELEASE).so; \
elif [ -r $$DIR/$$FMWK.framework/Versions/Current/$(TRIPLE)/lib$$FMWK-$(DEBIAN_RELEASE_FALLBACK).so ]; \
then echo $$DIR/$$FMWK.framework/Versions/Current/$(TRIPLE)/lib$$FMWK-$(DEBIAN_RELEASE_FALLBACK).so; \
elif [ -r $$DIR/$$FMWK.framework/Versions/Current/$(TRIPLE)/lib$$FMWK.so ]; \
then echo $$DIR/$$FMWK.framework/Versions/Current/$(TRIPLE)/lib$$FMWK.so; \
elif [ -L $$DIR/$$FMWK.framework/Versions/Current/$(TRIPLE)/$$FMWK ]; \
then echo $$DIR/$$FMWK.framework/Versions/Current/$(TRIPLE)/$$FMWK; \
fi; \
done; \
done)
# FMWKS := $(addprefix -l ,$(FRAMEWORKS))
endif
endif
ifeq ($(TRIPLE),MacOS)
LIBRARIES := \
$(FMWKS) \
$(LIBS)
else ifeq ($(TRIPLE),php)
# nothing
else
LIBRARIES := \
-Wl,-rpath-link,$(QuantumSTEP)/usr/lib \
-Wl,-rpath-link,$(TOOLCHAIN)/lib \
-L$(QuantumSTEP)/usr/lib \
-L$(TOOLCHAIN)/lib
LIBRARIES += $(FMWKS) $(LIBS)
# FIXME: do we still need this?
ifneq ($(OBJCSRCS)$(FMWKS),)
LIBRARIES += -lgcc_s
endif
endif
ifneq ($(OBJCSRCS)$(FMWKS),)
ifeq ($(filter -lobjc,$(LIBRARIES)),)
LIBRARIES += -lobjc
endif
ifeq ($(filter -lm,$(LIBRARIES)),)
LIBRARIES += -lm
endif
endif
# setup gcc
.SUFFIXES : .o .c .cpp .m .mm .lm .ym
ifeq ($(BUILD_FOR_DEPLOYMENT),true)
# ifneq ($(BUILD_STYLE),Development)
# optimize for speed
OPTIMIZE := 2
# should also remove headers and symbols
# STRIP_Framework := true
# remove MacOS X code
# STRIP_MacOS := true
# install in our file system so that we can build the package
INSTALL := true
# don't send to the device
DEPLOY := false
# and don't run
RUN := false
endif
# default to optimize depending on BUILD_STYLE
ifeq ($(OPTIMIZE),)
ifeq ($(BUILD_STYLE),Development)
OPTIMIZE := s
else
OPTIMIZE := $(GCC_OPTIMIZATION_LEVEL)
endif
endif
# add architecture specific CFLAGS
# workaround for bug in arm-linux-gnueabi toolchain
ifeq ($(TRIPLE),arm-linux-gnueabi)
OPTIMIZE := 3
STDCFLAGS += -fno-section-anchors -ftree-vectorize -mfpu=neon -mfloat-abi=softfp
endif
ifeq ($(TRIPLE),arm-linux-gnueabihf)
OPTIMIZE := 3
# we could try -mfloat-abi=hardfp
# see https://wiki.linaro.org/Linaro-arm-hardfloat
STDCFLAGS += -fno-section-anchors -ftree-vectorize # -mfpu=neon -mfloat-abi=hardfp
endif
ifeq ($(TRIPLE),MacOS)
STDCFLAGS += -Wno-deprecated-declarations
else
STDCFLAGS += -rdynamic
endif
STDCFLAGS += -fsigned-char
# set up appropriate STDCFLAGS for $(TRIPLE)
# -Wall
WARNINGS = -Wno-shadow -Wpointer-arith -Wno-import
# define as Objective-C string so that NSBundle knows it for finding the correct subdirectory
DEFINES += -DARCHITECTURE=@\"$(TRIPLE)\"
DEFINES += -DHAVE_MMAP
# add -v to debug include search path issues
STDCFLAGS += -g -fPIC -O$(OPTIMIZE) $(WARNINGS) $(DEFINES) $(INCLUDES)
ifeq ($(PROFILING),YES)
STDCFLAGS := -pg $(STDCFLAGS)
endif
# ifeq ($(GCC_WARN_ABOUT_MISSING_PROTOTYPES),YES)
# STDCFLAGS := -Wxyz $(STDCFLAGS)
# endif
# should be solved differently
ifneq ($(TRIPLE),arm-zaurus-linux-gnu)
OBJCFLAGS := $(STDCFLAGS) -fconstant-string-class=NSConstantString -D_NSConstantStringClassName=NSConstantString
endif
# define rules for .SUFFIXES
# adding /+ to the file path looks strange but is to avoid problems with ../neighbour/source.m
# if someone knows how to easily substitute ../ by ++/ or .../ in TARGET_BUILD_DIR we could avoid some other minor problems
# FIXME: please use $(subst ...)
# FIXME: this does not recognize changes/dependencies on .h files of a framework
$(TTT)+%.o: %.m # Obj-C
@- mkdir -p $(TTT)+$(*D)
# compile $< -> $*.o
@if ! $(CC) -v 2>/dev/null; then echo "can't find $(CC)"; false; fi
ifeq ($(INSPECT),true)
$(QUIET)$(CC) -c -std=gnu99 $(OBJCFLAGS) -E $< -o $(TTT)+$*.i # store preprocessor result for debugging
$(QUIET)$(CC) -c -std=gnu99 $(OBJCFLAGS) -S $< -o $(TTT)+$*.S # store assembler source for debugging
endif
$(QUIET)$(CC) -c -std=gnu99 $(OBJCFLAGS) $< -o $(TTT)+$*.o
$(TTT)+%.o: %.mm # Obj-C++
@- mkdir -p $(TTT)+$(*D)
# compile $< -> $*.o
@if ! $(CC) -v 2>/dev/null; then echo "can't find $(CC)"; false; fi
ifeq ($(INSPECT),true)
$(QUIET)$(CC) -c $(OBJCFLAGS) -E $< -o $(TTT)+$*.i # store preprocessor result for debugging
$(QUIET)$(CC) -c $(OBJCFLAGS) -S $< -o $(TTT)+$*.S # store assembler source for debugging
endif
$(QUIET)$(CC) -c $(OBJCFLAGS) $< -o $(TTT)+$*.o
$(TTT)+%.o: %.c # C
@- mkdir -p $(TTT)+$(*D)
# compile $< -> $*.o
@if ! $(CC) -v 2>/dev/null; then echo "can't find $(CC)"; false; fi
$(QUIET)$(CC) -c -std=gnu99 $(STDCFLAGS) $< -o $(TTT)+$*.o
$(TTT)+%.o: %.cpp # C++
@- mkdir -p $(TTT)+$(*D)
# compile $< -> $*.o
@if ! $(CC) -v 2>/dev/null; then echo "can't find $(CC)"; false; fi
$(QUIET)$(CC) -c $(STDCFLAGS) $< -o $(TTT)+$*.o
$(TTT)+%.o: %.php
# make $(TTT)+$*.o from $<
@- mkdir -p $(TTT)+$(*D)
ifneq ($(PHP),)
$(PHP) -l $< && $(PHP) -w $< >$(TTT)+$*.o
endif
# FIXME: handle .lm .ym
# FIXME: handle .xib
# FIXME: handle.xcassets
#
# makefile targets
#
# FIXME: we can't easily specify the build order (e.g. Foundation first, then AppKit and finally Cocoa)
build_subprojects:
# build_subprojects
# DEBIAN_RELEASE: $(DEBIAN_RELEASE)
# DEBIAN_ARCHITECTURES: $(DEBIAN_ARCHITECTURES)
# PROJECT_NAME: $(PROJECT_NAME)
# PRODUCT_NAME: $(PRODUCT_NAME)
# FRAMEWORK_VERSION: $(FRAMEWORK_VERSION)
# WRAPPER_EXTENSION: $(WRAPPER_EXTENSION)
ifeq ($(RECURSIVE),true)
# SUBPROJECTS: $(SUBPROJECTS)
# RECURSIVE: $(RECURSIVE)
ifneq "$(strip $(SUBPROJECTS))" ""
for i in $(SUBPROJECTS); \
do \
( unset TRIPLE PRODUCT_NAME DEBIAN_DEPENDS DEBIAN_RECOMMENDS DEBIAN_DESCRIPTION DEBIAN_PACKAGE_NAME FMWKS INCLUDES LIBS INSTALL_PATH PRODUCT_NAME SOURCES WRAPPER_EXTENSION FRAMEWORK_VERSION; cd $$(dirname $$i) && echo Entering directory $$(pwd) && ./$$(basename $$i) $(SUBCMD) || break ; echo Leaving directory $$(pwd) ); \
done
endif
endif
DEBIAN_PACKAGE_NAME:=$(shell echo $(DEBIAN_PACKAGE_NAME) | tr '_' '-')
make_bundle:
# make bundle
# DEBIAN_RELEASE: $(DEBIAN_RELEASE)
# DEBIAN_ARCH: $(DEBIAN_ARCH)
# DEBIAN_PACKAGE_NAME: $(DEBIAN_PACKAGE_NAME)
# TRIPLE: $(TRIPLE)
# EXEC: $(EXEC)
# BINARY: $(BINARY)
# PKG/NAME_EXT/CONTENTS: $(PKG)/$(NAME_EXT)/$(CONTENTS)
make_exec: "$(EXEC)"
# make exec "$(EXEC)"
make_binary: make_exec "$(BINARY)"
$(QUIET) [ -f "$(BINARY)" ] && ls -l "$(BINARY)" || true
ifeq ($(WRAPPER_EXTENSION),app)
expr "$(ENTITLEMENTS)" : "/tmp/*" >/dev/null && echo >$(ENTITLEMENTS) '<?xml version="1.0" encoding="UTF-8"?> \
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> \
<plist version="1.0"> \
<dict> \
<key>com.apple.security.app-sandbox</key> \
<false/> \
<key>com.apple.security.files.user-selected.read-write</key> \
<false/> \
</dict> \
</plist>' || true
[ -x /usr/bin/codesign ] && /usr/bin/codesign --force --sign - --entitlements $(ENTITLEMENTS) --timestamp=none --generate-entitlement-der "$(PKG)/$(NAME_EXT)"
endif
make_sh: bundle
@echo make_sh
# SHSRCS: $(SHSRCS)
$(QUIET)for SH in $(SHSRCS); do \
mkdir -p "$(PKG)/$(NAME_EXT)/$(CONTENTS)/Resources/" && \
chmod -Rf u+w "$(PKG)/$(NAME_EXT)/$(CONTENTS)/Resources/" && \
cp -pf "$$SH" "$(PKG)/$(NAME_EXT)/$(CONTENTS)/Resources/" && \
chmod -R go-w "$(PKG)/$(NAME_EXT)/$(CONTENTS)/Resources/"; \
done
@echo make_sh finished
DOXYDIST = "$(QuantumSTEP)/System/Installation/Doxy"
build_doxy: build/$(PRODUCT_NAME).docset
# build_doxy
# BUILD_DOCUMENTATION: $(BUILD_DOCUMENTATION)
ifeq ($(BUILD_DOCUMENTATION),true)
$(QUIET)- rsync -vaz ~/bk ~/test
$(QUIET)- true && [ -r build/$(PRODUCT_NAME).docset/html/index.html ] && rsync -avz $(PRODUCT_NAME).docset $(DOXYDIST)/ && \
( echo "<h1>Quantumstep Framework Documentation</h1>"; \
echo "<ul>"; \
for f in *.docset; \
do BN=$$(basename $$f .docset); \
echo "<li><a href=\"$$BN.docset/html/classes.html\">$$BN.framework</a></li>"; \
done; \
echo "<ul>" \
) >index.html )
$(QUIET)- false && [ -r build/$(PRODUCT_NAME).docset/html/index.html ] && (cd build && $(TAR) cf - $(PRODUCT_NAME).docset) | \
(mkdir -p $(DOXYDIST) && cd $(DOXYDIST) && rm -rf $(DOXYDIST)/$(PRODUCT_NAME).docset && \
$(TAR) xf - && \
( echo "<h1>Quantumstep Framework Documentation</h1>"; \
echo "<ul>"; \
for f in *.docset; \
do BN=$$(basename $$f .docset); \
echo "<li><a href=\"$$BN.docset/html/classes.html\">$$BN.framework</a></li>"; \
done; \
echo "<ul>" \
) >index.html )
endif
# rebuild if any header was changed
build/$(PRODUCT_NAME).docset: $(HEADERSRC)
ifeq ($(WRAPPER_EXTENSION),framework)
ifeq ($(BUILD_DOCUMENTATION),true)
$(QUIET)mkdir -p build
$(QUIET)- $(DOXYGEN) -g build/$(PRODUCT_NAME).doxygen
$(QUIET)pwd
echo "PROJECT_NAME = \"$(PRODUCT_NAME).$(WRAPPER_EXTENSION)\"" >>build/$(PRODUCT_NAME).doxygen
echo "PROJECT_BRIEF = \"a QuantumSTEP framework\"" >>build/$(PRODUCT_NAME).doxygen
# echo "INPUT = $(SOURCES)" >>build/$(PRODUCT_NAME).doxygen
echo "INPUT = $^" >>build/$(PRODUCT_NAME).doxygen
# echo "INPUT = $$PWD" >>build/$(PRODUCT_NAME).doxygen
echo "OUTPUT_DIRECTORY = $@" >>build/$(PRODUCT_NAME).doxygen
echo "GENERATE_LATEX = NO" >>build/$(PRODUCT_NAME).doxygen
echo "UML_LOOK = YES" >>build/$(PRODUCT_NAME).doxygen
echo "RECURSIVE = YES" >>build/$(PRODUCT_NAME).doxygen
echo "SOURCE_BROWSER = NO" >>build/$(PRODUCT_NAME).doxygen
echo "VERBATIM_HEADERS = YES" >>build/$(PRODUCT_NAME).doxygen
echo "EXCLUDE_PATTERNS = */build */.svn *.php" >>build/$(PRODUCT_NAME).doxygen
echo "GENERATE_DOCSET = YES" >>build/$(PRODUCT_NAME).doxygen
echo "DOCSET_BUNDLE_ID = com.quantumstep.$(PRODUCT_NAME)" >>build/$(PRODUCT_NAME).doxygen
$(QUIET)- $(DOXYGEN) build/$(PRODUCT_NAME).doxygen && touch $@
# make -C build/DoxygenDocs.docset/html # install
endif
endif
#
# Debian package builder
# see http://www.debian.org/doc/debian-policy/ch-controlfields.html
#
# add default dependency
# FIXME: eigentlich sollte zu jedem mit mystep-/quantumstep- beginnenden Eintrag von "DEPENDS" ein >= $(VERSION) zugefuegt werden
# damit auch abhaengige Pakete einen Versions-Upgrade bekommen
ifeq ($(DEBIAN_PACKAGE_NAME),)
ifeq ($(WRAPPER_EXTENSION),)
DEBIAN_PACKAGE_NAME = $(shell echo "QuantumSTEP-$(PRODUCT_NAME)" | tr "[:upper:]" "[:lower:]")
else
DEBIAN_PACKAGE_NAME = $(shell echo "QuantumSTEP-$(PRODUCT_NAME)-$(WRAPPER_EXTENSION)" | tr "[:upper:]" "[:lower:]")
endif
endif
ifneq ($(strip $(OBJCSRCS)),) # any objective C source
ifeq ($(DEBIAN_DESCRIPTION),)
DEBIAN_DESCRIPTION := part of QuantumSTEP Desktop/Palmtop Environment
endif
ifeq ($(DEBIAN_DEPENDS),)
DEPENDS := quantumstep-cocoa-framework
endif
ifeq ($(DEBIAN_HOMEPAGE),)
DEBIAN_HOMEPAGE := www.quantum-step.com
endif
endif
ifneq ($(strip $(PHPSRCS)),) # any PHP source
ifeq ($(DEBIAN_DESCRIPTION),)
DEBIAN_DESCRIPTION := part of QuantumSTEP Cloud
endif
endif
ifeq ($(DEBIAN_DESCRIPTION),)
DEBIAN_DESCRIPTION := built by mySTEP
endif
ifeq ($(DEBIAN_MAINTAINER),)
DEBIAN_MAINTAINER := info <info@goldelico.com>
endif
ifeq ($(DEBIAN_SECTION),)
DEBIAN_SECTION := x11
endif
ifeq ($(DEBIAN_PRIORITY),)
DEBIAN_PRIORITY := optional
endif
ifeq ($(DEBIAN_PACKAGE_VERSION),)
DEBIAN_PACKAGE_VERSION := 0.$(shell date '+%Y%m%d%H%M%S' )
endif
ifeq ($(DEBIAN_RELEASE),)
DEBIAN_RELEASE := staging
endif
ifeq ($(DEBDIST),)
DEBDIST="$(QuantumSTEP)/System/Installation/Debian/dists/$(DEBIAN_RELEASE)/main"
endif
# FIXME: allow to disable -dev and -dbg if we are marked "private"
# allow to disable building debian packages
build_deb: make_bundle bundle make_binary build_debian_packages
@echo build_deb done