File: Makefile.in

package info (click to toggle)
znc 0.045-3%2Betch3
  • links: PTS
  • area: main
  • in suites: etch
  • size: 1,120 kB
  • ctags: 2,324
  • sloc: cpp: 17,406; sh: 2,380; perl: 448; makefile: 134
file content (76 lines) | stat: -rw-r--r-- 2,137 bytes parent folder | download | duplicates (2)
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
prefix=@prefix@
CXX=@CXX@
CXXFLAGS=@CXXFLAGS@ -fPIC
INCLUDES=@INCLUDES@ -I..
LIBS=@LIBS@
PERL=@PERL@
ifneq "$(PERL)" ""
PERLCC=-DHAVE_PERL `$(PERL) -MExtUtils::Embed -e ccopts`
PERLLD=`$(PERL) -MExtUtils::Embed -e ccopts -e ldopts`
endif
VPATH=.:..

ifeq "@NOSSL@" "1" 
TARGETS=$(foreach file, $(wildcard *.cpp), $(if $(shell grep REQUIRESSL $(file)),, $(addsuffix .so, $(basename $(file)))))
INSTALL_TARGS=$(foreach file, $(wildcard *.cpp), $(if $(shell grep REQUIRESSL $(file)),, install_$(addsuffix .so, $(basename $(file)))))
OBJS=$(foreach file, $(wildcard *.cpp), $(if $(shell grep REQUIRESSL $(file)),, $(addsuffix .o, $(basename $(file)))))
SRCS=$(wildcard ../*.cpp) $(foreach file, $(wildcard *.cpp), $(if $(shell grep REQUIRESSL $(file)),,$(file)))
else
TARGETS=$(addsuffix .so, $(basename $(wildcard *.cpp)))
INSTALL_TARGS=$(foreach file, $(addsuffix .so, $(basename $(wildcard *.cpp))), install_$(file))
OBJS=$(addsuffix .o, $(basename $(wildcard *.cpp)))
SRCS=$(wildcard *.cpp) $(wildcard ../*.cpp)
endif

all: $(OBJS) $(TARGETS)

depend::
	$(CXX) -MM $(CXXFLAGS) $(SRCS) $(INCLUDES) $(PERLCC) >.depend

install: all create_install_dir install_metadirs $(INSTALL_TARGS)
	@echo -n ""

create_install_dir:
	mkdir -p $(DESTDIR)$(prefix)/lib/znc
	rm -rf $(DESTDIR)$(prefix)/lib/znc/*.so

install_metadirs:
	for a in *; do \
		if [ -d $$a ] && [ -f $${a}.so ]; then \
			cp -Rp $$a $(DESTDIR)$(prefix)/lib/znc; \
		fi \
	done

install_%:
	install -m 0755 $(subst install_,,$@) $(DESTDIR)$(prefix)/lib/znc

clean:
	rm -rf *.so *.o core core.*

-include .depend

%.so: %.o
	$(CXX) $(CXXFLAGS) -shared -o $@ $< $(INCLUDES) $(LIBS)

%.o: %.cpp
	$(CXX) $(CXXFLAGS) $(INCLUDES) -c -o $@ $<

ifneq "$(PERL)" ""
modperl.so: modperl.o
	$(CXX) $(CXXFLAGS) -shared -o $@ $< $(INCLUDES) $(LIBS) $(PERLLD)

modperl.o: modperl.cpp
	$(CXX) $(CXXFLAGS) $(INCLUDES) -c -o $@ modperl.cpp $(PERLCC)
install_modperl.so:
	install -m 0644 modperl.so $(DESTDIR)$(prefix)/lib/znc
	for i in *.pm; do \
		install -m 0644 $$i $(DESTDIR)$(prefix)/lib/znc; \
	done
else
modperl.so:
	@echo -n ""
modperl.o:
	@echo -n ""
install_modperl.so:
	@echo -n ""
endif