forked from cosmos72/twin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.sub
149 lines (116 loc) · 4.11 KB
/
Makefile.sub
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
# Copyright (C) 2000 by Massimiliano Ghilardi
#
# 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 2 of the License, or
# (at your option) any later version.
#
#
#
# top Makefile
#
ifneq ($(TOP_SRCDIR),)
T=$(TOP_SRCDIR)
endif
SUBDIRS=$(wildcard include docs themes libs clients server)
make_IDENTITY:=$(wordlist 1,2,$(shell $(MAKE) -v))
ifneq ($(make_IDENTITY),GNU Make)
all: make_is_not_GNU
make_is_not_GNU:
@echo [1m; \
echo "# Warning: GNU Make is required to build twin, but the '$(MAKE)' you are using" ; \
echo "# does not seem to be GNU Make. build will probably fail... " ; \
echo "# running '$(MAKE) -v' to get version information resulted in: " ; \
echo "--------------------------------------------------------" ; \
$(MAKE) -v ; \
echo "--------------------------------------------------------" ; \
echo [0m
endif
all: build-subdirs
@echo [1m; \
echo "# twin is now fully compiled." ; \
echo "# (if you want, you can build user-contributed programs with '$(MAKE) -C contrib')" ; \
echo "# As next step, you probably want to run '$(MAKE) install' as root." ; \
echo [0m
#
ifneq ($(wildcard $(B)conf/conf.current),)
include $(B)conf/conf.current
endif
include $(T)makerules.in
#
# ensure libraries are built first
#
dir-clients dir-server: dir-libs
dir-libs dir-docs: dir-include
dir-include: $(CONF) include/Tw/Twautoconf.h
do-autogen: dir-include
pre-autogen: include/autoconf.h
fakeconf:
if [ -f $(CONF) ]; then true; else touch $(CONF); fi
#
Torture: fakeconf autogen
#
install:
$(INSTALL-DIR) $(DESTDIR)$(libdir)/twin
$(INSTALL-TXT) $(T)system.twinrc $(DESTDIR)$(libdir)/twin
$(LN) system.twinrc $(DESTDIR)$(libdir)/twin/.twinrc
$(INSTALL-BIN) $(T)system.twenvrc.sh $(DESTDIR)$(libdir)/twin
$(LN) system.twenvrc.sh $(DESTDIR)$(libdir)/twin/.twenvrc.sh
ifeq ($(CONF__SHLIBS),y)
@echo [1m ; \
echo "# If this is the first time you installed twin $(TWIN_VERSION_STR)" ; \
echo "# you probably need to run some kind of administrative command" ; \
echo "# to let your system know about newly installed shared libraries" ; \
echo "# "
ifeq ($(SYS_SHLIBS),native)
@echo "# if you do not know what to run, you can try with:"
ifeq ($(OS),Linux)
@echo "# ldconfig"
else
@echo "# ldconfig -R"
endif
else
@echo "# if you do not know what to run, libtool can usually do it for you:" ; \
echo "# just execute:" ; \
echo "# libtool --finish $(libdir)"
endif
@echo
endif
@echo "# As next step, you probably want to run '$(MAKE) clean'" ; \
echo "# Or, if something went wrong, '$(MAKE) uninstall'" ; \
echo "# " ; \
echo "# Installation should be completed. Type 'twstart' and enjoy." ; \
echo [0m
uninstall:
cd $(DESTDIR)$(libdir)/twin && \
rm -f system.twinrc .twinrc system.twenvrc.sh .twenvrc.sh || true
rmdir $(DESTDIR)$(libdir)/twin || true
clean: fakeconf autogen
rm -f .dialog_* ; \
if [ ! -s $(CONF) ]; then rm -f $(CONF); fi
distclean: clean
rm -f $(CONF) \
config.status config.cache config.log libtool \
makeautoconf conf/conf.auto \
include/autoconf.h include/Tw/Twautoconf.h include/Tw/endianity.h \
scripts/Mkdep scripts/Bitmap scripts/Getsizes scripts/Endianity \
include/Tw/datasizes.h include/Tw/uni_types.h \
.*.conf .hdepend `find . -type l` \
`find . -name Makefile -o -name .modules -o -name .depend` && \
$(CP) $(T)Makefile.fake $(T)Makefile && \
rm -f $(DISTCLEAN_REMOVE_FILES) $(DISTCLEAN_EMPTY_FILES) && \
for i in $(DISTCLEAN_EMPTY_FILES); do \
echo > $$i; \
done && \
(find . -type f | xargs touch || true)
ifneq ($(MAINTAINER),)
pure: distclean
rm -f Makefile $(T)admin/config.* \
$(DISTCLEAN_REMOVE_FILES) $(DISTCLEAN_EMPTY_FILES) \
$(T)configure $(T)makeversion $(T)server/rcparse_*.? \
$(T)include/autoconf.h.in $(T)docs/ltrace.conf \
$(T)themes/hw_gfx/default_*.xpm \
`find $(T)include -name version.h` `find $(TT) -name '*_m4.[ch]'` \
`find $(TT) -name makefragment` \
$(PURE_REMOVE_FILES)
endif