-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmakefile.in
More file actions
1021 lines (885 loc) · 36.1 KB
/
makefile.in
File metadata and controls
1021 lines (885 loc) · 36.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
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
CC = @CC@
LD = @LD@
XCFLAGS =
ARCHFLAGS = @archflags@
CONFIG_CFLAGS = @CFLAGS@
CFLAGS = -I./include -DLIBU8_SOURCE=1 -g3 -O2 ${CONFIG_CFLAGS} \
-I./include $(XCFLAGS) $(ARCHFLAGS)
RPATH = @rpath@
RPATHFLAGS = @RPATHFLAGS@
XLDFLAGS =
LDFLAGS = @LDFLAGS@ $(EFENCE)
EXEFLAGS = @EXEFLAGS@
LIBS = @LIBS@ $(EFENCE) -lm
DYLIB_FLAGS = -compatibility_version @U8MAJOR@.@U8MINOR@ \
-current_version @U8MAJOR@.@U8MINOR@
INC = include/libu8
BUILDMODE := $(shell if test -f ./buildmode; then cat ./buildmode; else echo none; fi)
U8VERSION := $(shell cat ./etc/base_version)
U8PATCHVERSION := $(shell ./scripts/u8_gitversion ./etc/base_version)
DESTDIR =
prefix = @prefix@
exec_prefix = @exec_prefix@
datarootdir = @datarootdir@
datadir = @datadir@
LOCALEDIR = $(DESTDIR)@localedir@
MANDIR = $(DESTDIR)@mandir@
LIBSOURCE = lib
EXESOURCE = exe
LIBINSTALLDIR = $(DESTDIR)@libdir@
EXEINSTALLDIR = $(DESTDIR)@bindir@
ENCDIR = $(DESTDIR)@prefix@/share/libu8/encodings
XRPMFLAGS =
RPMFLAGS = $(XRPMFLAGS) @RPMFLAGS@
RPMDIR = @RPMDIR@
GPG = @GPG@
GPGID = $(cat .gpgid 2>/dev/null || echo @GPGID@)
GZIP = @GZIP@
CLEAN = @CLEAN@
SUDO = @SUDO@
INSTALL = @INSTALL@ -m a+r,ug+w
INSTALLEXE = @INSTALL@ -m a+rx,ug+wx
INSTALLDIR = @INSTALL@ -m a+rx,ug+wx -d
RANLIB = @RANLIB@
MKSTATIC = @MKSTATIC@ -o
DOXYGEN = @doxygen@
CODENAME = @CODENAME@
APT_INCOMING = dev.beingmeta.com:/srv/repo/@REPONAME@/apt/incoming/@CODENAME@/
MKSO = $(CC) $(CFLAGS) $(XCFLAGS) -shared -L./lib \
$(LDFLAGS) $(XLDFLAGS) $(LIBS)
#MACLIBTOOL = libtool -dynamic -single_module $(LDFLAGS) $(LIBS)
MACLIBTOOL = $(CC) -dynamiclib -single_module $(LDFLAGS) $(LIBS)
RPMGPG = %__gpg gpg --force-v3-sigs --digest-algo=sha1 -u \
\"%{_gpg_name}\" --no-armor --no-secmem-warning \
-sbo %{__signature_filename} %{__plaintext_filename}
APKREPO := $(shell ./etc/getbuildopt APKREPO /srv/repo/kno/apk)
PATCHVERSION := $(shell ./scripts/u8_gitversion etc/base_version)
REL_BRANCH := $(shell ./etc/getbuildopt REL_BRANCH current)
REL_STATUS := $(shell ./etc/getbuildopt REL_STATUS stable)
REL_PRIORITY := $(shell ./etc/getbuildopt REL_PRIORITY medium)
ARCH := $(shell ./etc/getbuildopt BUILD_ARCH || uname -m)
APK_ARCH_DIR := ${APKREPO}/staging/${ARCH}
COMPONENT=main
VERSION_H = include/libu8/u8_version.h
LIBU8_HEADERS= \
${INC}/cityhash.h ${INC}/config.h ${INC}/libu8.h ${INC}/libu8io.h \
${INC}/u8appid.h ${INC}/u8appinfo.h ${INC}/u8status.h ${INC}/u8bytebuf.h \
${INC}/u8contour.h ${INC}/u8convert.h ${INC}/u8crypto.h ${INC}/u8ctype.h \
${INC}/u8defines.h ${INC}/u8digest.h ${INC}/u8dirfns.h ${INC}/u8elapsed.h \
${INC}/u8endian.h ${INC}/u8error.h ${INC}/u8exceptions.h \
${INC}/u8filefns.h ${INC}/u8fileio.h ${INC}/u8findfiles.h ${INC}/u8gettext.h \
${INC}/u8libc.h ${INC}/u8logging.h ${INC}/u8malloc.h ${INC}/u8millitime.h \
${INC}/u8mktime.h ${INC}/u8netfns.h ${INC}/u8pathfns.h ${INC}/u8piles.h \
${INC}/u8printf.h ${INC}/u8random.h ${INC}/u8rusage.h ${INC}/u8signals.h \
${INC}/u8sleep.h ${INC}/u8source.h ${INC}/u8sourcefiles.h ${INC}/u8srvfns.h \
${INC}/u8stdio.h ${INC}/u8streamio.h ${INC}/u8stringfns.h ${INC}/u8strings.h \
${INC}/u8strcmp.h \
${INC}/u8subscribe.h ${INC}/u8threading.h ${INC}/u8timefns.h ${INC}/u8timestrings.h \
${INC}/u8uuid.h ${INC}/u8xfiles.h ${INC}/u8xtime.h ${INC}/u8xtimefns.h
LIBU8_SOURCES=\
libu8.c streamio.c printf.c atomic.c logging.c exceptions.c ctype.c stringfns.c \
libu8fns.c timefns.c netfns.c srvfns.c rusage.c contour.c cityhash.c status.c \
digestfns.c cryptofns.c pathfns.c filefns.c fileio.c \
libu8io.c xfiles.c convert.c filestring.c bytebuf.c \
u8run.c \
tests/latin1u8.c tests/xtimetest.c tests/u8recode.c tests/u8xrecode.c \
tests/echosrv.c tests/printftest.c
COMMON_HEADERS= $(LIBU8_HEADERS)
LIBU8CORE_OBJECTS=libu8.o streamio.o threading.o stringfns.o \
contour.o logging.o signals.o exceptions.o status.o \
ctype.o printf.o atomic.o bytebuf.o cityhash.o
LIBU8FNS_OBJECTS=libu8fns.o netfns.o srvfns.o \
pathfns.o filefns.o fileio.o \
rusage.o timefns.o digestfns.o \
cryptofns.o
LIBU8IO_OBJECTS=libu8io.o xfiles.o convert.o filestring.o
LIBU8DATA_OBJECTS=chardata.o
LIBU8STDIO_OBJECTS=u8stdio.o
LIBU8SYSLOG_OBJECTS=u8syslog.o
LIBU8_OBJECTS=$(LIBU8CORE_OBJECTS) $(LIBU8IO_OBJECTS) $(LIBU8FNS_OBJECTS) $(LIBU8SYSLOG_OBJECTS)
TESTBIN=tests/u8recode tests/latin1u8 tests/u8xrecode tests/getentity \
tests/echosrv tests/xtimetest tests/printftest
DYTESTBIN=tests/dynamic/u8recode tests/dynamic/latin1u8 \
tests/dynamic/u8xrecode tests/dynamic/getentity \
tests/dynamic/echosrv tests/xtimetest
STATIC_LIBS=lib/libu8.a lib/libu8core.a lib/libu8io.a lib/libu8fns.a \
lib/libu8data.a lib/libu8stdio.a lib/libu8syslog.a
SHARED_LIBS=lib/libu8.@shared_suffix@ lib/libu8fns.@shared_suffix@ \
lib/libu8io.@shared_suffix@ lib/libu8data.@shared_suffix@ \
lib/libu8stdio.@shared_suffix@ lib/libu8syslog.@shared_suffix@
STATIC_TEST_LIBS=lib/libu8.a
SHARED_TEST_LIBS=lib/libu8.@shared_suffix@
ALL=@TAGS_TARGET@ libs exe @I18N@ tests alldocs
update: buildmode
@make TAGS
@make `cat buildmode`
normal:
@make TAGS
@echo "# (libu8)" Building NORMAL configuration
@make ${ALL}
debugging:
@make TAGS
@echo "# (libu8)" Building DEBUGGING configuration
make XCFLAGS="@debugcflags@ $(XCFLAGS)" ${ALL}
optimizing:
@make TAGS
@echo "# (libu8)" Building OPTIMIZING configuration
make XCFLAGS="-O3" ${ALL}
nitpicking:
@make TAGS
@echo "# (libu8)" Building NITPICKING configuration
make XCFLAGS="-Wall" ${ALL}
all: ${ALL}
debug:
@if test $(BUILDMODE) != "debugging"; then \
echo debugging > buildmode; fi
@make `cat buildmode`
standard:
@if test $(BUILDMODE) != "normal"; then echo normal > buildmode; fi
@make `cat buildmode`
nitpick:
@if test $(BUILDMODE) != "nitpicking"; then \
echo nitpicking > buildmode; fi
@make `cat buildmode`
fast production:
@if test $(BUILDMODE) != "optimizing"; then \
echo optimizing > buildmode; fi
@make `cat buildmode`
tests: $(TESTBIN) $(DYTESTBIN)
buildmode:
@if test -f buildmode; then \
touch buildmode; \
else echo normal > buildmode; \
fi
showbuildmode showmode showbuild: buildmode
@cat buildmode
.PHONY: showbuildmode showmode showbuild tests fast nitpick standard debug all
# Versioning
VERSION:
@if test -d .git; then \
scripts/u8_gitversion etc/base_version > $@; \
elif test -f $@; then \
touch VERSION; \
else echo $(cat etc/base_version).0 > $@; \
fi;
include/libu8/u8_version.h: VERSION etc/base_version makefile.in
@BASE_VERSION=$$(cat etc/base_version); \
VERSION=$$(cat VERSION 2>/dev/null || scripts/u8_gitversion etc/base_version); \
GIT_VERSION=$$(cat FULL_VERSION 2>/dev/null || \
scripts/u8_gitversion etc/base_version -full || \
echo $$VERSION); \
MAJOR_VERSION=$$(echo $${VERSION} | cut - -d '.' -f 1); \
MINOR_VERSION=$$(echo $${VERSION} | cut - -d '.' -f 2); \
PATCHEVEL=$$(echo $${VERSION} | cut - -d '.' -f 3); \
BRANCH=$$(cat BRANCH 2>/dev/null || scripts/u8_gitbranch || echo none); \
echo "#define U8_VERSION \"$$VERSION\"" > $@; \
echo "#define U8_MAJOR_VERSION $$MAJOR_VERSION" >> $@; \
echo "#define U8_MINOR_VERSION $$MINOR_VERSION" >> $@; \
echo "#define U8_PATCHLEVEL $$PATCHLEVEL" >> $@; \
echo "#define U8_SOURCE_BRANCH $$BRANCH" >> $@; \
echo "#define LIBU8_VERSION \"libu8-$$VERSION\"" >> $@; \
echo "#define LIBU8_BASE_VERSION \"libu8-$$BASE_VERSION\"" >> $@; \
echo "#define LIBU8_GIT_VERSION \"libu8-$$FULL_VERSION\"" >> $@;
# configure/autoconf stuff
# If the generated makefile is the same as the current makefile,
# revert it (especially it's date) to avoid needless rebuilds.
makefile: makefile.in etc/base_version config.status
@mv makefile makefile.tmp
@./config.status
@if diff makefile makefile.tmp 2>&1 > /dev/null; then \
mv makefile.tmp makefile; \
else \
echo "# (libu8)" Updated makefile; \
fi
./config.status: configure
./config.status --recheck
configure: configure.ac etc/base_version
@if test -f .autoautoconf; then \
echo "# (libu8)" "REBUILDING configure"; autoconf; \
else echo "# (libu8) WARNING: configure may be out of date"; \
fi
include/libu8/config.h: include/libu8/config.h.in
./config.status
touch -r $< $@
include/libu8/u8source.h: include/libu8/u8source.h.in
./config.status
touch -r $< $@
# Fileinfo gets version-related information about a file to pass in
# with -D
exe/u8_fileinfo: etc/u8_fileinfo.c
$(CC) -o exe/u8_fileinfo etc/u8_fileinfo.c
# Makes everything and then sudoes install. Keeps build files non-root
suinstall:
make all
sudo make install
dbginstall:
make XCFLAGS="-O0" all
sudo make install
.PHONY: suinstall dbginstall
# Make rules
%.o: %.c exe/u8_fileinfo ${VERSION_H}
@echo "# (libu8)" CC $@ $<
@$(CC) $(CFLAGS) @definefileinfo@ -o $@ -c $<
tests/%: tests/%.c
@echo "# (libu8)" CC_STATIC_TEST $@ $<
@$(CC) $(CFLAGS) $(LDFLAGS) -L./lib -o $@ $< ${STATIC_TEST_LIBS} ${LIBS}
tests/dynamic/%: tests/%.c
@echo "# (libu8)" CC_DYNAMIC_TEST $@ $<
@$(CC) $(CFLAGS) -L./lib $(LDFLAGS) -o $@ $< -lu8
exe/%: %.c lib/libu8.@shared_suffix@
@echo "# (libu8)" CC_EXE $@ $<
@$(CC) $(CFLAGS) -L./lib $(LDFLAGS) $(EXEFLAGS) \
-o $@ $< -lu8
exe/%.static: %.c lib/libu8.a
@echo "# (libu8)" CC_EXE $@ $<
@$(CC) $(CFLAGS) -g3 -O0 -L./lib $(LDFLAGS) $(EXEFLAGS) \
-o $@ $< lib/libu8.a ${LIBS}
lib/%@suffix@.a:
@echo "# (libu8)" MKSTATIC $@ $^
@$(MKSTATIC) $@ $^
lib/%@suffix@.so.@U8VERSION@:
@echo "# (libu8)" MKSO $@
@$(MKSO) -Wl,-soname=`basename $(@F) .@U8MINOR@` \
-L./lib -o $@ $^ $(LIBS) -lu8
lib/%@suffix@.so: lib/%@suffix@.so.@U8VERSION@
@ln -sf $(<F) $@
@ln -sf $(<F) $@.@U8MAJOR@
lib/%@suffix@.dylib:
@echo "# (libu8)" MACLIBTOOL $@
@$(MACLIBTOOL) -install_name \
@rpath/lib/`basename $(@F) .dylib`.@U8MAJOR@.dylib \
$(DYLIB_FLAGS) -o $@ $^
@ln -sf $(@F) $(@D)/$(*F).@U8MAJOR@.dylib
lib/stripped/%: lib/%
@cp $< $@
@strip $@
exe/stripped/%: exe/%
@cp $< $@
@strip $@
$(LIBINSTALLDIR)/%.a: ${LIBSOURCE}/%.a
@echo "# (libu8)" Installing $@ from $<
@$(SUDO) $(INSTALLDIR) $(LIBINSTALLDIR)
@$(SUDO) $(INSTALLEXE) $< $(LIBINSTALLDIR)
$(LIBINSTALLDIR)/%@suffix@.so.@U8VERSION@: ${LIBSOURCE}/%@suffix@.so
@echo "# (libu8)" Installing $@ from $<
@$(SUDO) $(INSTALLDIR) $(@D)
@$(SUDO) $(INSTALLEXE) $< $@
$(LIBINSTALLDIR)/%@suffix@.so.@U8MAJOR@: \
$(LIBINSTALLDIR)/%@suffix@.so.@U8VERSION@
@echo "# (libu8)" Linking $< to $@
@$(SUDO) ln -sf $(shell basename $<) $@
$(LIBINSTALLDIR)/%@suffix@.so: $(LIBINSTALLDIR)/%@suffix@.so.@U8VERSION@
@echo "# (libu8)" Linking to $@
@$(SUDO) ln -sf $(shell basename $<) $@
$(LIBINSTALLDIR)/%@suffix@.@U8VERSION@.dylib: ${LIBSOURCE}/%@suffix@.dylib
@echo "# (libu8)" Installing $@
@$(SUDO) $(INSTALLDIR) $(LIBINSTALLDIR)
@$(SUDO) $(INSTALLEXE) $< $@
$(LIBINSTALLDIR)/%@suffix@.@U8MAJOR@.dylib: \
$(LIBINSTALLDIR)/%@suffix@.@U8VERSION@.dylib
@echo "# (libu8)" Linking $< to $@
@$(SUDO) ln -sf $(shell basename $<) $@
$(LIBINSTALLDIR)/%@suffix@.dylib: $(LIBINSTALLDIR)/%@suffix@.@U8VERSION@.dylib
@echo "# (libu8)" Linking $< to $@
@$(SUDO) ln -sf $(shell basename $<) $@
$(LIBINSTALLDIR)/%@suffix@.dylib: \
$(LIBINSTALLDIR)/%@suffix@.@U8VERSION@.dylib
@echo "# (libu8)" Linking to $@
@$(SUDO) ln -sf $(shell basename $<) $@
$(EXEINSTALLDIR)/%: ${EXESOURCE}/%
@echo "# (libu8)" Installing exe $@
@$(SUDO) $(INSTALLDIR) $(EXEINSTALLDIR)
@$(SUDO) $(INSTALLEXE) $< $(EXEINSTALLDIR)
$(EXEINSTALLDIR)/%: etc/%
@echo "# (libu8)" Installing script $@ from $<
@$(SUDO) $(INSTALLDIR) $(EXEINSTALLDIR)
@$(SUDO) $(INSTALLEXE) $< $(EXEINSTALLDIR)
$(EXEINSTALLDIR)/%: scripts/%
@echo "# (libu8)" Installing script $@ from $<
@$(SUDO) $(INSTALLDIR) $(EXEINSTALLDIR)
@$(SUDO) $(INSTALLEXE) $< $(EXEINSTALLDIR)
check:
test: @test_shared@ @test_static@
test-shared: $(DYTESTBIN)
test-static: $(TESTBIN)
$(TESTBIN): ${STATIC_LIBS} ${VERSION_H}
$(DYTESTBIN): ${SHARED_LIBS} ${VERSION_H}
TAGS: tests/*.c include/libu8/*.h *.c
@echo "# (libu8)" Making TAGS table
@etags tests/*.c include/libu8/*.h *.c
NOTAGS:
@echo "# (libu8)" Not making tags table
exe: @shared_exe@ @static_exe@
static-exe: exe/u8run.static
shared-exe: exe/u8run
# Custom test rules
tests/printftest: tests/printftest.c
@echo "# (libu8)" CC_STATIC_TEST $@ $<
@$(CC) $(CFLAGS) $(LDFLAGS) -L./lib -o $@ $< \
${STATIC_TEST_LIBS} lib/libu8stdio.a ${LIBS}
tests/dynamic/printftest: tests/printftest.c
@echo "# (libu8)" CC_DYNAMIC_TEST $@ $<
@$(CC) $(CFLAGS) -L./lib $(LDFLAGS) -o $@ $< -lu8 -lu8stdio
libs: @build_shared@ @build_static@
static-libs: ${STATIC_LIBS}
shared-libs: ${SHARED_LIBS}
lib/libu8.a: $(LIBU8_OBJECTS)
lib/libu8@suffix@.so.@U8VERSION@: $(LIBU8_OBJECTS)
lib/libu8.dylib: $(LIBU8_OBJECTS)
lib/libu8.dll: $(LIBU8_OBJECTS)
# Avoid recursive reference for the libu8 library itself
lib/libu8@suffix@.so.@U8VERSION@: $(LIBU8_OBJECTS)
@echo "# (libu8)" MKSO $@ $^
@$(MKSO) -Wl,-soname=libu8@suffix@.so.@U8MAJOR@ \
-L./lib -o $@ $^ $(LIBS)
lib/libu8core.a: $(LIBU8CORE_OBJECTS)
lib/libu8core@suffix@.so.@U8VERSION@: $(LIBU8CORE_OBJECTS)
lib/libu8core.dylib: $(LIBU8CORE_OBJECTS)
lib/libu8core.dll: $(LIBU8CORE_OBJECTS)
# Avoid recursive reference
lib/libu8core@suffix@.so.@U8VERSION@:
@$(MKSO) -Wl,-soname=$(@F).@U8MAJOR@ -L./lib -o $@ $^ $(LIBS)
@echo "# (libu8)" MKSO $@
lib/libu8fns.a: $(LIBU8FNS_OBJECTS)
lib/libu8fns@suffix@.so.@U8VERSION@: $(LIBU8FNS_OBJECTS)
lib/libu8fns.dylib: $(LIBU8FNS_OBJECTS) lib/libu8.dylib
lib/libu8fns.dll: $(LIBU8FNS_OBJECTS) libu8.dll
lib/libu8data.a: $(LIBU8DATA_OBJECTS)
lib/libu8data@suffix@.so.@U8VERSION@: $(LIBU8DATA_OBJECTS)
lib/libu8data.dylib: $(LIBU8DATA_OBJECTS) lib/libu8.dylib lib/libu8fns.dylib
lib/libu8data.dll: $(LIBU8DATA_OBJECTS) lib/libu8.dll lib/libu8fns.dll
lib/libu8io.a: $(LIBU8IO_OBJECTS)
lib/libu8io@suffix@.so.@U8VERSION@: $(LIBU8IO_OBJECTS)
lib/libu8io.dylib: $(LIBU8IO_OBJECTS) \
lib/libu8.dylib lib/libu8fns.dylib
lib/libu8io.dll: $(LIBU8IO_OBJECTS) lib/libu8.dll lib/libu8fns.dll
lib/libu8stdio.a: $(LIBU8STDIO_OBJECTS)
lib/libu8stdio@suffix@.so.@U8VERSION@: $(LIBU8STDIO_OBJECTS)
lib/libu8stdio.dylib: $(LIBU8STDIO_OBJECTS) lib/libu8.dylib
lib/libu8stdio.dll: $(LIBU8STDIO_OBJECTS) lib/libu8.dll
lib/libu8syslog.a: $(LIBU8SYSLOG_OBJECTS)
lib/libu8syslog@suffix@.so.@U8VERSION@: $(LIBU8SYSLOG_OBJECTS)
lib/libu8syslog.dylib: $(LIBU8SYSLOG_OBJECTS) lib/libu8.dylib
lib/libu8syslog.dll: $(LIBU8SYSLOG_OBJECTS) lib/libu8.dll
# Clean/rebuild/reconfig targets
clean:
@$(CLEAN) VERSION REVISION
@$(CLEAN) *.o *.a *@suffix@.so *.dylib *@suffix@.so.* etc/fileinfo
@$(CLEAN) lib/*.o lib/*.a lib/*@suffix@.so lib/*.dylib lib/*@suffix@.so.*
@echo "# (libu8)" "Cleaned up libraries"
@$(CLEAN) exe/u8run exe/u8run.static
@echo "# (libu8)" "Cleaned up exes"
@$(CLEAN) docs/*.done
@$(CLEAN) docs/man/man3/* docs/man/man1/* docs/rtf/* docs/latex/*
@$(CLEAN) docs/man/*.[1234567]
@for dir in docs/html docs/html/search; do \
$(CLEAN) $${dir}/*.html $${dir}/*.png $${dir}/*.js $${dir}/*.css; done
@echo "# (libu8)" "Cleaned up docs"
@$(CLEAN) tests/getentity tests/latin1u8 tests/u8recode tests/u8xrecode
@$(CLEAN) tests/echosrv
@echo "# (libu8)" "Cleaned up static test executables"
@$(CLEAN) tests/dynamic/getentity tests/dynamic/latin1u8
@$(CLEAN) tests/dynamic/u8recode tests/dynamic/u8xrecode
@$(CLEAN) tests/dynamic/echosrv
@echo "# (libu8)" "Cleaned up dynamic test executables"
@if test -d debian/libu8; then \
rm -rf debian/libu8; \
echo "# (libu8)" "Cleaning up debian build"; \
fi
tidy:
@$(CLEAN) *~ tests/*~ include/libu8/*~
distclean: clean
@$(CLEAN) makefile include/libu8/config.h include/libu8/revision.h include/libu8/u8_version.h
@$(CLEAN) config.log config.status config.cache
fresh rebuild: clean
make
reconfig reconfigure: distclean
configure; make;
.PHONY: clean tidy distclean fresh rebuild reconfig reconfigure
# Internationalization stuff
$(LOCALEDIR)/%/LC_MESSAGES/libu8msg.mo: etc/intl/%.gmo
install $^ $@
etc/intl/libu8msg.pot: *.c tests/*.c
@@XGETTTEXT@ -dlibu8 -oetc/intl/libu8msg.pot -k_ *.c tests/*.c
etc/intl/%.po: etc/intl/libu8msg.pot
@@MSGMERGE@ -U $@ $<
etc/intl/%.gmo: etc/intl/%.po
@@MSGFMT@ $^ -o $@
install-i18n: $(LOCALEDIR)/fr/LC_MESSAGES/libu8msg.mo \
$(LOCALEDIR)/es/LC_MESSAGES/libu8msg.mo \
$(LOCALEDIR)/nl/LC_MESSAGES/libu8msg.mo
i18n: etc/intl/fr.gmo etc/intl/nl.gmo etc/intl/es.gmo
# dependencies
streamio.o printf.o atomic.o status.o logging.o exceptions.o signals.o chardata.o stringfns.o convert.o libu8.o libu8io.o: \
$(COMMON_HEADERS) include/libu8/u8_version.h
ctype.o: $(COMMON_HEADERS) entities.h
status.o: $(COMMON_HEADERS) include/libu8/u8appid.h
atomic.o: $(COMMON_HEADERS) include/libu8/u8atomic.h
cityhash.o: $(COMMON_HEADERS) include/libu8/cityhash.h
timefns.o: $(COMMON_HEADERS) include/libu8/u8timefns.h
rusage.o: $(COMMON_HEADERS) include/libu8/u8rusage.h
printf.o: $(COMMON_HEADERS) include/libu8/libu8io.h include/libu8/u8printf.h
xfiles.o: $(COMMON_HEADERS) include/libu8/libu8io.h include/libu8/u8xfiles.h
netfns.o: $(COMMON_HEADERS) include/libu8/libu8io.h include/libu8/u8netfns.h
srvfns.o: $(COMMON_HEADERS) \
include/libu8/libu8io.h include/libu8/u8netfns.h \
include/libu8/u8srvfns.h
$(LIBU8CORE_OBJECTS) $(LIBU8FNS_OBJECTS) $(LIBU8DATA_OBJECTS): \
buildmode makefile
$(LIBU8IO_OBJECTS) $(LIBU8STDIO_OBJECTS) $(LIBU8SYSLOG_OBJECTS): \
buildmode makefile
# Installation targets
install: install-core install-docs install-static install-dev
install-core: install-shared install-exe install-scripts install-encodings @INSTALLI18N@
install-dev: install-headers install-pkgconfig install-dev-scripts
install-shared: @install_shared@
install-libs: install-static install-shared
install-bin: install-shared install-static install-exe
install-scripts: $(EXEINSTALLDIR)/u8_xsubst $(EXEINSTALLDIR)/u8ctl
install-dev-scripts: $(EXEINSTALLDIR)/u8_xsubst $(EXEINSTALLDIR)/u8ctl \
$(EXEINSTALLDIR)/u8_gitpatchcount $(EXEINSTALLDIR)/u8_gitbranch \
$(EXEINSTALLDIR)/u8_gitversion $(EXEINSTALLDIR)/u8_gitcommit \
$(EXEINSTALLDIR)/u8_aptversion $(EXEINSTALLDIR)/u8_debchangelog \
$(EXEINSTALLDIR)/u8_install_shared $(EXEINSTALLDIR)/u8_gzinstall \
$(EXEINSTALLDIR)/u8_dupload $(EXEINSTALLDIR)/u8_install_version
install-stripped:
make LIBSOURCE=lib/stripped LIBSOURCE=exe/stripped install-bin
install-extras: install-encodings @INSTALLI18N@ install-doc
install-headers: $(DESTDIR)@prefix@/include/libu8
@echo "# (libu8) Installing headers in $(DESTDIR)@prefix@/include/libu8"
@$(SUDO) $(INSTALL) include/libu8/*.h $(DESTDIR)@prefix@/include/libu8
$(DESTDIR)@prefix@/include/libu8:
$(SUDO) $(INSTALLDIR) $(DESTDIR)@prefix@/include/libu8
install-pkgconfig: $(DESTDIR)@PKGCONFIG_DIR@
@echo "# (libu8) Installing libu8 pkgconfig file in $(DESTDIR)@PKGCONFIG_DIR@"
@$(SUDO) $(INSTALL) etc/libu8.pc $(DESTDIR)@PKGCONFIG_DIR@
$(DESTDIR)@PKGCONFIG_DIR@:
$(SUDO) $(INSTALLDIR) $(DESTDIR)@PKGCONFIG_DIR@
# Installing documentation
install-static: $(LIBINSTALLDIR)/libu8.a \
$(LIBINSTALLDIR)/libu8io.a \
$(LIBINSTALLDIR)/libu8fns.a \
$(LIBINSTALLDIR)/libu8data.a \
$(LIBINSTALLDIR)/libu8stdio.a \
$(LIBINSTALLDIR)/libu8syslog.a
install-exe: $(EXEINSTALLDIR)/u8run $(EXEINSTALLDIR)/u8_fileinfo
install-so: $(LIBINSTALLDIR)/libu8@suffix@.so \
$(LIBINSTALLDIR)/libu8@suffix@.so.@U8MAJOR@ \
$(LIBINSTALLDIR)/libu8@suffix@.so.@U8VERSION@ \
$(LIBINSTALLDIR)/libu8io@suffix@.so \
$(LIBINSTALLDIR)/libu8io@suffix@.so.@U8MAJOR@ \
$(LIBINSTALLDIR)/libu8io@suffix@.so.@U8VERSION@ \
$(LIBINSTALLDIR)/libu8fns@suffix@.so \
$(LIBINSTALLDIR)/libu8fns@suffix@.so.@U8MAJOR@ \
$(LIBINSTALLDIR)/libu8fns@suffix@.so.@U8VERSION@ \
$(LIBINSTALLDIR)/libu8data@suffix@.so \
$(LIBINSTALLDIR)/libu8data@suffix@.so.@U8MAJOR@ \
$(LIBINSTALLDIR)/libu8data@suffix@.so.@U8VERSION@ \
$(LIBINSTALLDIR)/libu8stdio@suffix@.so \
$(LIBINSTALLDIR)/libu8stdio@suffix@.so.@U8MAJOR@ \
$(LIBINSTALLDIR)/libu8stdio@suffix@.so.@U8VERSION@ \
$(LIBINSTALLDIR)/libu8syslog@suffix@.so \
$(LIBINSTALLDIR)/libu8syslog@suffix@.so.@U8MAJOR@ \
$(LIBINSTALLDIR)/libu8syslog@suffix@.so.@U8VERSION@
install-dylib: $(LIBINSTALLDIR)/libu8.dylib \
$(LIBINSTALLDIR)/libu8.@U8MAJOR@.dylib \
$(LIBINSTALLDIR)/libu8.@U8VERSION@.dylib \
$(LIBINSTALLDIR)/libu8io.dylib \
$(LIBINSTALLDIR)/libu8io.@U8MAJOR@.dylib \
$(LIBINSTALLDIR)/libu8io.@U8VERSION@.dylib \
$(LIBINSTALLDIR)/libu8fns.dylib \
$(LIBINSTALLDIR)/libu8fns.@U8MAJOR@.dylib \
$(LIBINSTALLDIR)/libu8fns.@U8VERSION@.dylib \
$(LIBINSTALLDIR)/libu8data.dylib \
$(LIBINSTALLDIR)/libu8data.@U8MAJOR@.dylib \
$(LIBINSTALLDIR)/libu8data.@U8VERSION@.dylib \
$(LIBINSTALLDIR)/libu8stdio.dylib \
$(LIBINSTALLDIR)/libu8stdio.@U8MAJOR@.dylib \
$(LIBINSTALLDIR)/libu8stdio.@U8VERSION@.dylib \
$(LIBINSTALLDIR)/libu8syslog.dylib \
$(LIBINSTALLDIR)/libu8syslog.@U8MAJOR@.dylib \
$(LIBINSTALLDIR)/libu8syslog.@U8VERSION@.dylib
install-dll: libu8.dll libu8io.dll \
libu8fns.dll libu8data.dll \
libu8stdio.dll \
$(LIBINSTALLDIR)
$(SUDO) $(INSTALL) -D $^ $(LIBINSTALLDIR)
ENCODINGS=\
encodings/ISO88591 \
encodings/ISO88593 \
encodings/ISO88594 \
encodings/ISO88595 \
encodings/ISO88597 \
encodings/ISO885913 \
encodings/ISO885915 \
encodings/ISO885916 \
encodings/ISO88598 \
encodings/ISO88599 \
encodings/ISO885910 \
encodings/ISO885911 \
encodings/ISO885914 \
encodings/KOI8 \
encodings/KOI8R \
encodings/MACINTOSH \
encodings/ISO_6937 \
encodings/GBK \
encodings/SHIFT_JIS \
encodings/CP1125 \
encodings/CP1251 \
encodings/CP1252 \
encodings/CP1253 \
encodings/CP1254 \
encodings/CP1255 \
encodings/CP1256 \
encodings/CP1257 \
encodings/CP1258 \
encodings/GB2312 \
encodings/ISO88592 \
encodings/BIG5 \
encodings/EUCJP \
encodings/EUCKR \
encodings/EUCTW \
encodings/GREEK7 \
encodings/SHIFT_JISX0213 \
encodings/MACCYRILLIC \
encodings/MACCENTRALEUROPE \
encodings/TSCII \
encodings/VISCII
CP1125_ALIASES=MSEE WINDOWS1250
CP1250_ALIASES=MSEE WINDOWS1250
CP1251_ALIASES=MSCYRL WINDOWS1251
CP1252_ALIASES=MS1252 WINDOWS1252 MSANSI
CP1253_ALIASES=MS1252 WINDOWS1253 MSGREEK
CP1254_ALIASES=MS1254 WINDOWS1254 MSTURK
CP1255_ALIASES=MS1255 WINDOWS1255 MSHEBR
CP1256_ALIASES=MS1256 WINDOWS1256 MSARAB
CP1257_ALIASES=MS1257 WINDOWS1257 WINBALTRIM
CP1258_ALIASES=MS1258 WINDOWS1258
ISO88591_ALIASES=CP819 CSISOLATIN IBM819 ISOIR100 L1 LATIN1
ISO88592_ALIASES=CSISOLATIN2 ISOIR101 L2 LATIN2
ISO88593_ALIASES=CSISOLATIN3 ISOIR109 L3 LATIN3
ISO88594_ALIASES=CSISOLATIN4 ISOIR110 L4 LATIN4
ISO88595_ALIASES=CSISOLATINCYRILLIC CYRILLIC ISOIR144 L4 LATIN4
ISO88596_ALIASES=ARABIC ASMO708 CSISOLATINARABIC ECMA114 ISOIR127
ISO88597_ALIASES=CSISOLATINGREEK ECMA118 ELOT928 GREEK GREEK8 ISOIR126
ISO88598_ALIASES=CSISOLATINHEBREW HEBREW ISOIR138
ISO88599_ALIASES=CSISOLATIN5 ISOIR148 L5 LATIN5
EUCJP_ALIASES=CSEUCJP UJIS XEUCJP
EUCKR_ALIASES=CSEUCKR
EUCTW_ALIASES=CNS11643
#KOI8_ALIASES=
KOI8R_ALIASES=CSKOI8R
SHIFTJIS_ALIASES=CSSHIFTJIS MSKANJI SJIS SJIS
#SHIFTJISX2013_ALIASES=
GB2312_ALIASES=CHINESE CSGB2312 CSISO58GB231280,ISOIR58
GBK_ALIASES=CP936 MS936 WINDOWS936
#GREEK7_ALIASES=
BIG5_ALIASES=BIGFIVE CN-BIG5 CSBIG5
MACINTOSH_ALIASES=MACROMAN CSMACINTOSH MAC
install-encodings: $(DESTDIR)@prefix@/share/libu8/encodings
@echo "# (libu8)" Installing encodings in $(ENCDIR)
@$(SUDO) $(INSTALL) $(ENCODINGS) $(ENCDIR)
@for x in $(CP1125_ALIASES); do \
if ! test -h $(ENCDIR)/$$x; \
then $(SUDO) ln -sf CP1125 $(ENCDIR)/$$x; fi; done; \
for x in $(CP1250_ALIASES); do \
if ! test -h $(ENCDIR)/$$x; \
then $(SUDO) ln -sf CP1250 $(ENCDIR)/$$x; fi; done; \
for x in $(CP1251_ALIASES); do \
if ! test -h $(ENCDIR)/$$x; \
then $(SUDO) ln -sf CP1251 $(ENCDIR)/$$x; fi; done; \
for x in $(CP1252_ALIASES); do \
if ! test -h $(ENCDIR)/$$x; \
then $(SUDO) ln -sf CP1252 $(ENCDIR)/$$x; fi; done; \
for x in $(CP1253_ALIASES); do \
if ! test -h $(ENCDIR)/$$x; \
then $(SUDO) ln -sf CP1253 $(ENCDIR)/$$x; fi; done; \
for x in $(CP1254_ALIASES); do \
if ! test -h $(ENCDIR)/$$x; \
then $(SUDO) ln -sf CP1254 $(ENCDIR)/$$x; fi; done; \
for x in $(CP1255_ALIASES); do \
if ! test -h $(ENCDIR)/$$x; \
then $(SUDO) ln -sf CP1255 $(ENCDIR)/$$x; fi; done; \
for x in $(CP1256_ALIASES); do \
if ! test -h $(ENCDIR)/$$x; \
then $(SUDO) ln -sf CP1256 $(ENCDIR)/$$x; fi; done; \
for x in $(CP1257_ALIASES); do \
if ! test -h $(ENCDIR)/$$x; \
then $(SUDO) ln -sf CP1257 $(ENCDIR)/$$x; fi; done; \
for x in $(CP1258_ALIASES); do \
if ! test -h $(ENCDIR)/$$x; \
then $(SUDO) ln -sf CP1258 $(ENCDIR)/$$x; fi; done; \
for x in $(ISO88591_ALIASES); do \
if ! test -h $(ENCDIR)/$$x; \
then $(SUDO) ln -sf ISO88591 $(ENCDIR)/$$x; fi; done; \
for x in $(ISO88592_ALIASES); do \
if ! test -h $(ENCDIR)/$$x; \
then $(SUDO) ln -sf ISO88592 $(ENCDIR)/$$x; fi; done; \
for x in $(ISO88593_ALIASES); do \
if ! test -h $(ENCDIR)/$$x; \
then $(SUDO) ln -sf ISO88593 $(ENCDIR)/$$x; fi; done; \
for x in $(ISO88594_ALIASES); do \
if ! test -h $(ENCDIR)/$$x; \
then $(SUDO) ln -sf ISO88594 $(ENCDIR)/$$x; fi; done; \
for x in $(ISO88595_ALIASES); do \
if ! test -h $(ENCDIR)/$$x; \
then $(SUDO) ln -sf ISO88595 $(ENCDIR)/$$x; fi; done; \
for x in $(ISO88596_ALIASES); do \
if ! test -h $(ENCDIR)/$$x; \
then $(SUDO) ln -sf ISO88596 $(ENCDIR)/$$x; fi; done; \
for x in $(ISO88597_ALIASES); do \
if ! test -h $(ENCDIR)/$$x; \
then $(SUDO) ln -sf ISO88597 $(ENCDIR)/$$x; fi; done; \
for x in $(ISO88598_ALIASES); do \
if ! test -h $(ENCDIR)/$$x; \
then $(SUDO) ln -sf ISO88598 $(ENCDIR)/$$x; fi; done; \
for x in $(ISO88599_ALIASES); do \
if ! test -h $(ENCDIR)/$$x; \
then $(SUDO) ln -sf ISO88599 $(ENCDIR)/$$x; fi; done; \
for x in $(EUCJP_ALIASES); do \
if ! test -h $(ENCDIR)/$$x; \
then $(SUDO) ln -sf EUCJP $(ENCDIR)/$$x; fi; done; \
for x in $(EUCKR_ALIASES); do \
if ! test -h $(ENCDIR)/$$x; \
then $(SUDO) ln -sf EUCKR $(ENCDIR)/$$x; fi; done; \
for x in $(EUCTW_ALIASES); do \
if ! test -h $(ENCDIR)/$$x; \
then $(SUDO) ln -sf EUCTW $(ENCDIR)/$$x; fi; done; \
for x in $(KOI8R_ALIASES); do \
if ! test -h $(ENCDIR)/$$x; \
then $(SUDO) ln -sf KOI8R $(ENCDIR)/$$x; fi; done; \
for x in $(SHIFTJIS_ALIASES); do \
if ! test -h $(ENCDIR)/$$x; \
then $(SUDO) ln -sf SHIFTJIS $(ENCDIR)/$$x; fi; done; \
for x in $(GB2312_ALIASES); do \
if ! test -h $(ENCDIR)/$$x; \
then $(SUDO) ln -sf GB2312 $(ENCDIR)/$$x; fi; done; \
for x in $(GBK_ALIASES); do \
if ! test -h $(ENCDIR)/$$x; \
then $(SUDO) ln -sf GBK $(ENCDIR)/$$x; fi; done; \
for x in $(BIG5_ALIASES); do \
if ! test -h $(ENCDIR)/$$x; \
then $(SUDO) ln -sf BIG5 $(ENCDIR)/$$x; fi; done; \
for x in $(MACINTOSH_ALIASES); do \
if ! test -h $(ENCDIR)/$$x; \
then $(SUDO) ln -sf MACINTOSH $(ENCDIR)/$$x; fi; done; \
for x in $(MACCYRILLIC_ALIASES); do \
if ! test -h $(ENCDIR)/$$x; \
then $(SUDO) ln -sf MACCYRILLIC $(ENCDIR)/$$x; fi; done; \
for x in $(MACCENTRALEUROPE_ALIASES); do \
if ! test -h $(ENCDIR)/$$x; \
then $(SUDO) ln -sf MACCENTRALEUROPE $(ENCDIR)/$$x; fi; done;
$(DESTDIR)@prefix@/share/libu8/encodings:
$(SUDO) $(INSTALLDIR) $(DESTDIR)@prefix@/share/libu8/encodings
# Documentation
alldocs: @DOCTARGETS@
install-docs: alldocs
make @DOCINSTALL@
docs/doxygen.done: $(LIBU8_HEADERS) docs/doxygen.cfg
@$(DOXYGEN) docs/doxygen.cfg > docs/doxygen.log \
&& touch docs/doxygen.done
@echo "# (libu8)" DOXYGEN man pages
docs/ronn.done: docs/ronn/*.ronn
(cd docs; make manpages htmlpages htmlfrags) && touch $@
@echo "# (libu8)" Authored man pages
libu8.org: docs/doxygen.done
aws s3 cp --recursive docs/html/ s3://www.libu8.org/docs/
install-core-manpages: alldocs
@$(SUDO) $(INSTALLDIR) $(MANDIR);
@$(SUDO) $(INSTALLDIR) $(MANDIR)/man1;
@for manpage in docs/man/*.1; do \
if test -f "$${manpage}"; then \
base=$$(basename $${manpage}); \
if [ ! -z "${GZIPMAN}" ] && [ ! -z ${GZIP} ]; then \
${GZIP} -fk $${manpage} && \
manpage=$${manpage}.gz && \
base=$${base}.gz; fi; \
(${SUDO} ${INSTALL} $${manpage} $(MANDIR)/man1/$${base}); \
fi; \
done;
install-dev-manpages: alldocs
@echo "# (libu8)" "Writing man pages from doxygen"
@$(SUDO) $(INSTALLDIR) $(MANDIR);
@$(SUDO) $(INSTALLDIR) $(MANDIR)/man3;
@for manpage in docs/man/man3/*.3; do\
if test -f "$${manpage}"; then \
base=$$(basename $${manpage}); \
if [ ! -z "${GZIPMAN}" ] && [ ! -z ${GZIP} ]; then \
${GZIP} -fk $${manpage} && \
manpage=$${manpage}.gz && \
base=$${base}.gz; fi; \
(${SUDO} ${INSTALL} $${manpage} $(MANDIR)/man3/$${base}); \
fi; \
done;
# Packaging targets
debian deb debs: status/debian.done
rpms: status/rpms.done
.PHONY: rpms debian debs
.PRECIOUS: status/rpms.done status/rpms.built status/rpms.ready status/rpms.signed
# RPMs
install-rpms rpminstall installrpms: status/rpms.installed
status/rpms.installed: status/rpms.done
$(SUDO) rpm -Uvh dist/*.rpm dist/@target_cpu@/*.rpm && touch $@
pkgclean:
rm -rf staging/libu8* staging/*.tar staging/*.gz dist/*.tar dist/*.gz
rm -f dist/*.deb dist/*.dsc dist/*.changes dist/*.buildinfo
rm -f status/*.*
find dist -name "*.rpm" -writable | xargs -r rm
rm -rf staging/alpine*
cleandist cleanrpms cleandeb rpmclean debclean: pkgclean
.PHONY: cleandist cleanrpms cleandeb rpmclean debclean pkgclean
# Making a source tarball
dist/libu8.tar: VERSION $(LIBU8_SOURCES) $(LIBU8_HEADERS) makefile makefile.in
@git archive -o dist/libu8.tar HEAD
@tar -rf dist/libu8.tar VERSION
@cd dist; ln -s libu8.tar source.tar
dist/source.tar: libu8.tar
@cd dist; ln -s libu8.tar source.tar
staging/libu8: VERSION $(LIBU8_SOURCES) $(LIBU8_HEADERS) makefile makefile.in
@git archive --prefix=libu8/ -o staging/libu8.tar HEAD
@cd staging; tar -xf libu8.tar; rm libu8.tar;
@cp VERSION staging/libu8
# Creating staging areas from GIT
staging/libu8_@U8VERSION@: VERSION
make staging/libu8;
cd staging; mv libu8/dist/debian libu8/debian;
scripts/u8_debchangelog libu8 ${CODENAME} \
${PATCHVERSION} ${REL_BRANCH} ${REL_STATUS} ${REL_PRIORITY} \
< dist/debian/changelog \
> staging/libu8/debian/changelog;
rm -rf staging/libu8_@U8VERSION@;
cd staging; mv libu8 libu8_@U8VERSION@;
cd staging; tar -czvf libu8_@U8VERSION@.tar.gz libu8_@U8VERSION@
staging/libu8_@U8VERSION@.tar.gz: staging/libu8_@U8VERSION@
# RPM rules
staging/libu8-@U8VERSION@: $(LIBU8_SOURCES) $(LIBU8_HEADERS)
@rm -rf staging/libu8-@U8VERSION@
@git archive --prefix=libu8-@U8VERSION@/ \
-o staging/libu8-@U8VERSION@.tar HEAD
@cd staging; tar -xf libu8-@U8VERSION@.tar; rm libu8-@U8VERSION@.tar
@cp dist/libu8.spec staging/libu8-@U8VERSION@/dist/libu8-@U8MAJOR@.@U8MINOR@.spec;
@./scripts/u8_gitversion etc/base_version -full > staging/libu8-@U8VERSION@/GITINFO
staging/libu8-@U8VERSION@.tar.gz: $(LIBU8_SOURCES) $(COMMON_HEADERS)
@make staging/libu8-@U8VERSION@
@tar -czvf $@ -C staging libu8-@U8VERSION@
status/rpms.ready:
(make staging/libu8-@U8VERSION@.tar.gz) && touch $@
status/rpms.built: staging/libu8-@U8VERSION@ staging/libu8-@U8VERSION@.tar.gz
@@buildrpm@ $(RPMFLAGS) \
--define="_rpmdir $(RPMDIR)" \
--define="_srcrpmdir $(RPMDIR)" \
--nodeps -ta \
staging/libu8-@U8VERSION@.tar.gz && \
touch status/rpms.ready
status/rpms.signed: status/rpms.built
echo "# (libu8) Enter passphrase for '$(GPGID)':"; \
@rpm@ --addsign --define="_gpg_name $(GPGID)" \
--define="__gpg_sign_cmd $(RPMGPG)" \
$(RPMDIR)/libu8-@U8VERSION@*.src.rpm \
$(RPMDIR)/*/libu8*-@U8VERSION@-*.rpm;
status/rpms.done: status/rpms.built
@(if (test "$(GPGID)" = "none" || test "$(GPGID)" = ""); then \
echo "Skipping RPM signing"; \
else make status/rpms.signed; fi) && \
touch $@ && \
ls -l $(RPMDIR)/libu8-@U8VERSION@-*.src.rpm \
$(RPMDIR)/*/libu8*-@U8VERSION@-*.rpm;
rpmupdate update-rpms freshrpms rpmfresh: cleanrpms
@rm -f status/rpms.done status/rpms.ready
@make status/rpms.done RPMDIR=$(RPMDIR) GPGID=$(GPGID:-default)
dist/rpms.zip: dist/rpms.done
@rm -f dist/rpms.zip
@zip dist/rpms.zip \
$(RPMDIR)/libu8*-@U8VERSION@-*.src.rpm \
$(RPMDIR)/*/libu8-@U8VERSION@-*.rpm
.PHONY: rpms rpmupdate update-rpms freshrpms rpmfresh
# Rules for debian building
status/debian.ready: VERSION $(LIBU8_SOURCES) $(LIBU8_HEADERS)
./make_source_tar staging/libu8_${U8PATCHVERSION}.tar \
libu8_${U8PATCHVERSION} && \
(cd staging; tar xf libu8_${U8PATCHVERSION}.tar ) && \
(cd staging/libu8_${U8PATCHVERSION}; \
cp -r dist/debian debian; \
scripts/u8_debchangelog libu8 ${CODENAME} \
${PATCHVERSION} ${REL_BRANCH} ${REL_STATUS} ${REL_PRIORITY} \
< dist/debian/changelog > debian/changelog )
status/debian.built: status/debian.ready
(cd staging/libu8_${U8PATCHVERSION}; \
dpkg-buildpackage -b -us -uc -sa -rfakeroot) && \
(mv staging/libu8_${U8PATCHVERSION}.tar dist && \
mv staging/libu8*_${U8PATCHVERSION}*[.]* dist) && \
touch status/debian.built;
status/debian.signed: status/debian.built
debsign -p${GPG} --re-sign -k${GPGID} \
dist/libu8_${U8PATCHVERSION}*.changes && \
touch $@;
status/debian.done: status/debian.built
@(if test "${GPGID}" = "none" || test "${GPGID}" = ""; then \
echo "Skipping GPG signing of debian packages"; \
else make status/debian.signed; fi ) && \
touch $@ && \
ls dist/libu8*${U8PATCHVERSION}*;
install-debian install-debian debinstall installdeb: status/debian.installed
# We install twice because sometimes, when a file is moved from one package into another,
# it works, while still failing for more serious reasons
status/debian.installed: status/debian.done
@$(SUDO) dpkg -i dist/libu8*@U8VERSION@*.deb && touch $@
install-debian install-debs debinstall installdebs: status/debian.installed
status/debian.uploaded: status/debian.done
@./scripts/u8_dupload dist/libu8_@U8VERSION@*.changes ${APT_INCOMING} && touch debs.uploaded
update-apt apt-upload: status/debian.uploaded
.PHONY: install-debian install-debian debinstall installdeb update-apt
debfresh freshdeb:
@make debclean
@rm -f include/libu8/u8_version.h; make include/libu8/u8_version.h
@make debian
.PHONY: debfresh freshdeb
debupdate: VERSION
@SRCVERSION=$(shell cat VERSION); \
if [ "${SRCVERSION}" = "libu8_${PATCHVERSION}" ]; then \
echo "Debian build of utf8 is up to date"; \
else make debfresh; fi;
build-setup.debian:
$(SUDO) apt-get install libssl-dev uuid uuid-dev
build-setup-ubuntu: build-setup.debian
.PHONY: build-setup.debian build-setup.ubuntu
# deb-s3 upload --bucket=repo.beingmeta.com \
# --component=$(COMPONENT) \
# --codename=$(CODENAME) \
# --sign=$(GPGID) \
# dist/libu8*_@U8VERSION@*.deb
# Alpine packaging
dist/alpine/APKBUILD: dist/alpine/APKBUILD.in
./config.status
staging/alpine:
@@INSTALL@ -d $@
staging/alpine/APKBUILD: dist/alpine/APKBUILD staging/alpine
cp dist/alpine/APKBUILD staging/alpine
staging/alpine/libu8-@U8VERSION@.tar.gz: VERSION staging/alpine
git archive --prefix=libu8/ -o staging/alpine/libu8-@U8VERSION@.tar HEAD
cd staging/alpine; tar -xf libu8-@U8VERSION@.tar;
cp VERSION staging/alpine/libu8;
cd staging/alpine; tar -czf libu8-@U8VERSION@.tar.gz libu8;
rm -rf staging/alpine/libu8 staging/alpine/libu8-@U8VERSION@.tar
status/alpine.ready: staging/alpine/APKBUILD include/libu8/u8_version.h makefile
make staging/alpine/libu8-@U8VERSION@.tar.gz staging/alpine/APKBUILD && \
if test ! -d ${APK_ARCH_DIR}; then mkdir -p ${APK_ARCH_DIR}; fi && \
( cd staging/alpine; \
abuild -P ${APKREPO} clean cleancache cleanpkg && \
abuild -P ${APKREPO} checksum ) && \
touch $@