File: Makefile.export

package info (click to toggle)
libint2 2.3.0~beta3-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 14,432 kB
  • ctags: 5,089
  • sloc: cpp: 32,063; ansic: 26,475; sh: 3,080; makefile: 943; perl: 482; python: 129
file content (49 lines) | stat: -rw-r--r-- 1,230 bytes parent folder | download
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

TOPDIR=.
TO_TOPDIR=$(TOPDIR)
ifndef SRCDIR
  SRCDIR=$(shell pwd)
endif
TOPOBJDIR = $(shell ls -d `pwd`/$(TOPDIR))

NAME = libint
VERSION = 2
NAMEV = $(NAME)$(VERSION)
TARGET = $(NAMEV).$(LIBSUF)

-include $(TOPDIR)/MakeVars
-include $(TOPDIR)/MakeRules
-include $(TOPDIR)/MakeSuffixRules
VPATH = $(SRCTOPDIR)/src $(SRCTOPDIR)/include

TRUESRC = $(shell echo `find src -name '*.cc' -exec echo -n '{} ' \;`)
LIBOBJ = $(TRUESRC:%.cc=%.$(OBJSUF))

default:: $(TOPDIR)/lib/$(TARGET)

# this is how the static library is made
# NOTE: the library is made from scratch every time and the prerequisite variable is not used to avoid overflow
$(TOPDIR)/lib/$(NAMEV).a: $(LIBOBJ)
	/bin/rm -f $@
	find src -name '*.$(OBJSUF)' -print0 | xargs -0 $(AR) $(ARFLAGS) $@
	$(RANLIB) $@

# this is how shared library is made
$(TOPDIR)/lib/$(NAMEV).la: $(LIBOBJ)
	find . -name '*.$(OBJSUF)' -print > libobjlist
	$(LTLINK) $(CXX) -o $@ -objectlist libobjlist $(LTLINKLIBOPTS)
	-rm -f libobjlist

check: all
	(cd tests && make check) || exit 1

.PHONY: doc
doc:
	(cd doc && make) || exit 1

install_doc::
	(cd doc && make install) || exit 1

oclean::
	find src -name '*.$(OBJSUF)' -print0 | xargs -0 rm -f
	find src -name '*.o' -print0 | xargs -0 rm -f