-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
121 lines (94 loc) · 3.13 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
#
# pBat Makefiles, The pBat project
# Copyright (C) 2012-2018 Romain Garbi, Teddy Astie
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
ifneq (,$(wildcard ./femto-config.mk))
include femto-config.mk
endif
BINDIR ?= bin
SUBDIRS_ADD ?=
SUBDIR_PO =
SUBDIRS_EVAL =
ifeq ($(use_libcu8),1)
SUBDIRS_ADD = libcu8
endif
ifeq ($(use_nls),1)
SUBDIR_PO = po
endif
SUBDIRS = microgettext libpbat libfasteval $(SUBDIRS_ADD) pbat pbatize dump tea \
scripts modules $(SUBDIR_PO)
TEAFILES = README.tea WHATSNEW.tea GUIDELINES.tea THANKS.tea
TEXTFILES = $(TEAFILES:.tea=.txt)
MDFILES = $(TEAFILES:.tea=.md)
MANFILES = man/en_US/readme.tea
SUBDIRS_CLEAN := $(addsuffix .clean,$(SUBDIRS))
SUBDIRS_BIN := $(addsuffix .bin,$(SUBDIRS))
HOST = $(shell $(CC) -dumpmachine)
YEAR = $(shell date +%Y)
PACKAGE = picobat
PACKAGE_URL = http://picobat.org
PACKAGE_BUGREPORT = [email protected]
VERSION = $(shell date +%Y | sed s/0//).$(shell date +%m)
all: $(SUBDIRS) $(MDFILES)
$(SUBDIRS):
$(MAKE) -C $@
clean: $(SUBDIRS_CLEAN)
rm -f $(TEXTFILES)
rm -rf $(BINDIR)
$(SUBDIRS_CLEAN):
$(MAKE) -C $(basename $@) clean
bin: all bindir $(SUBDIRS_BIN)
dist: bin
mv bin picobat-$(VERSION)
zip -r picobat-$(VERSION).zip picobat-$(VERSION)
src-dist:
tar zcf picobat-$(VERSION)-src.tar.gz --transform 's,^,picobat-$(VERSION)/,' `git ls-files`
git-dist: bin
tar zcf picobat-$(VERSION)-`git rev-parse --short HEAD`.tar.gz $(BINDIR)
bindir: $(MANFILES) $(TEXTFILES)
mkdir -p $(BINDIR)
mkdir -p $(BINDIR)/cmd
cp $(TEXTFILES) $(BINDIR)/
cp COPYING* $(BINDIR)/
textfiles: $(TEXTFILES) $(MDFILES)
man/en_US/readme.tea : README.tpl
cat $< doc.ft | sed -e s,\{doc/,\{,g > $@
doc.md: README.tpl
cat README.tpl doc.ft > .README.tea
./tea/tea$(EXEC_SUFFIX) -e:utf-8 -o:md .README.tea .doc.md
cat doc.hd .doc.md > doc.md
rm .README.tea .doc.md
.tpl.tea:
cat $< repo.ft | sed -e s,\{doc[^}]*\|,\{,g > $@
.tea.txt:
./tea/tea$(EXEC_SUFFIX) -e:utf-8 -o:text-plain $< $@
.tea.md:
./tea/tea$(EXEC_SUFFIX) -e:utf-8 -o:md $< $@
$(SUBDIRS_BIN): $(SUBDIRS)
$(MAKE) -C $(basename $@) bin || true
# stuff to check
PROGRAMS = mimeopen xdg-open
FUNCTIONS = WIN32 MINGW_W64
LIBS = pthread m dl
FLAGS = PIC
OPTIONS = libcu8 nls cmdlycorrect console modules linenoise w10ansi
DEFAULTOPTIONS = no-libcu8 use-nls no-cmdlycorrect use-console use-modules \
use-linenoise no-w10ansi
SUBCONFIG = libcu8
ADDITIONALVARS = HOST BINDIR YEAR VERSION PACKAGE PACKAGE_URL PACKAGE_BUGREPORT
include femto.mk
.PHONY: all bin bindir clean $(SUBDIRS) $(SUBDIRS_CLEAN) textfiles dist
.SUFFIXES: .tea .txt .md .tpl