summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkraxel <kraxel>2008-10-30 09:29:19 +0000
committerkraxel <kraxel>2008-10-30 09:29:19 +0000
commit7c080383cd6cc523b0bd196dc5d13112d3929b24 (patch)
treedd90c10d84de781f73dfa97adfeec9a2c87b490d
parentba6b4eb60efa1219346be89c2a7cb78247cea07c (diff)
downloadamtterm-7c080383cd6cc523b0bd196dc5d13112d3929b24.tar.gz
sync makefile bits
-rw-r--r--INSTALL2
-rw-r--r--mk/Autoconf.mk22
-rw-r--r--mk/Compile.mk20
-rw-r--r--mk/Variables.mk1
4 files changed, 39 insertions, 6 deletions
diff --git a/INSTALL b/INSTALL
index 8f99186..8ac42dc 100644
--- a/INSTALL
+++ b/INSTALL
@@ -56,4 +56,4 @@ Have fun,
Gerd
--
-Gerd Hoffmann <kraxel@suse.de>
+Gerd Hoffmann <kraxel@redhat.com>
diff --git a/mk/Autoconf.mk b/mk/Autoconf.mk
index 65cd915..7608ea5 100644
--- a/mk/Autoconf.mk
+++ b/mk/Autoconf.mk
@@ -47,6 +47,11 @@ ac_uname = $(shell \
$(call ac_s_cmd,uname -s | tr 'A-Z' 'a-z');\
$(call ac_fini))
+ac_uname_arch = $(shell \
+ $(call ac_init,for arch);\
+ $(call ac_s_cmd,uname -m | tr 'A-Z' 'a-z');\
+ $(call ac_fini))
+
# check for some header file
# args: header file
ac_header = $(shell \
@@ -80,11 +85,12 @@ ac_lib = $(shell \
# check if some compiler flag works
# args: compiler flag
ac_cflag = $(shell \
- $(call ac_init,if $(CC) supports $(1));\
+ $(call ac_init,for $(CC) cflags);\
echo 'int main() {return 0;}' > __actest.c;\
$(call ac_b_cmd,$(CC) $(CFLAGS) $(1) $(LDFLAGS) -o \
__actest __actest.c);\
rm -f __actest __actest.c;\
+ if test "$${rc}" = "yes"; then rc="$(1)"; else rc="$(2)"; fi;\
$(call ac_fini))
# check for some binary
@@ -97,9 +103,14 @@ ac_binary = $(shell \
$(call ac_fini))
# check if lib64 is used
+#ac_lib64 = $(shell \
+# $(call ac_init,for libdir name);\
+# $(call ac_s_cmd,$(CC) -print-search-dirs | grep -q lib64 &&\
+# echo "lib64" || echo "lib");\
+# $(call ac_fini))
ac_lib64 = $(shell \
$(call ac_init,for libdir name);\
- $(call ac_s_cmd,$(CC) -print-search-dirs | grep -q lib64 &&\
+ $(call ac_s_cmd,/sbin/ldconfig -p | grep -q lib64 &&\
echo "lib64" || echo "lib");\
$(call ac_fini))
@@ -122,6 +133,13 @@ ac_pkg_config = $(shell \
$(call ac_b_cmd, pkg-config $(1));\
$(call ac_fini))
+# grep some file
+# args: regex, file
+ac_grep = $(shell \
+ $(call ac_init,for $(1) in $(2));\
+ $(call ac_b_cmd, grep -q $(1) $(2));\
+ $(call ac_fini))
+
########################################################################
# build Make.config
diff --git a/mk/Compile.mk b/mk/Compile.mk
index da14d58..ae88f14 100644
--- a/mk/Compile.mk
+++ b/mk/Compile.mk
@@ -21,6 +21,7 @@ depfile = mk/$(subst /,_,$*).dep
depfiles = mk/*.dep
compile_c = $(CC) $(CFLAGS) -Wp,-MD,$(tmpdep) -c -o $@ $<
+compile_c_pic = $(CC) $(CFLAGS) -fPIC -Wp,-MD,$(tmpdep) -c -o $@ $<
compile_cc = $(CXX) $(CXXFLAGS) -Wp,-MD,$(tmpdep) -c -o $@ $<
fixup_deps = sed -e "s|.*\.o:|$@:|" < $(tmpdep) > $(depfile) && rm -f $(tmpdep)
cc_makedirs = mkdir -p $(dir $@) $(dir $(depfile))
@@ -35,6 +36,7 @@ msgfmt_po = msgfmt -o $@ $<
# non-verbose output
ifeq ($(verbose),no)
echo_compile_c = echo " CC " $@
+ echo_compile_c_pic = echo " CC " $@
echo_compile_cc = echo " CXX " $@
echo_link_app = echo " LD " $@
echo_link_so = echo " LD " $@
@@ -43,6 +45,7 @@ ifeq ($(verbose),no)
echo_msgfmt_po = echo " MSGFMT " $@
else
echo_compile_c = echo $(compile_c)
+ echo_compile_c_pic = echo $(compile_c_pic)
echo_compile_cc = echo $(compile_cc)
echo_link_app = echo $(link_app)
echo_link_so = echo $(link_so)
@@ -57,6 +60,12 @@ endif
@$(compile_c)
@$(fixup_deps)
+%.opic: %.c
+ @$(cc_makedirs)
+ @$(echo_compile_c_pic)
+ @$(compile_c_pic)
+ @$(fixup_deps)
+
%.o: %.cc
@$(cc_makedirs)
@$(echo_compile_cc)
@@ -70,13 +79,18 @@ endif
@$(fixup_deps)
+%: %.o
+ @$(echo_link_app)
+ @$(link_app)
+
%.so: %.o
@$(echo_link_so)
@$(link_so)
-%: %.o
- @$(echo_link_app)
- @$(link_app)
+%.a: %.o
+ @$(echo_ar_lib)
+ @$(ar_lib)
+
%.moc : %.h
@$(echo_moc_h)
diff --git a/mk/Variables.mk b/mk/Variables.mk
index fdb1653..99f787c 100644
--- a/mk/Variables.mk
+++ b/mk/Variables.mk
@@ -6,6 +6,7 @@ DESTDIR =
srcdir ?= .
prefix ?= /usr/local
bindir = $(DESTDIR)$(prefix)/bin
+sbindir = $(DESTDIR)$(prefix)/sbin
libdir = $(DESTDIR)$(prefix)/$(LIB)
shrdir = $(DESTDIR)$(prefix)/share
mandir = $(shrdir)/man