File: Makefile

package info (click to toggle)
prayer 1.3.5-dfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 6,396 kB
  • ctags: 3,309
  • sloc: ansic: 43,161; makefile: 810; sh: 451; perl: 166
file content (47 lines) | stat: -rw-r--r-- 1,836 bytes parent folder | download | duplicates (6)
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
# $Cambridge: hermes/src/prayer/templates/src/Makefile,v 1.5 2010/07/08 09:37:08 dpc22 Exp $

ifeq ($(strip $(RPM_BUILD)), true)
include ../../Config-RPM
else
include ../../Config
endif

CFLAGS  = $(BASECFLAGS)
LDFLAGS = $(BASELDFLAGS)

LIB= ../../lib/lib_nossl.a

all: template_expand template_compile template-set.make

template_expand: template_expand_main.o log.o empty.o $(LIB)
	$(CC) $(LDFLAGS) -o template_expand log.o empty.o template_expand_main.o $(LIB) $(BASE_LIBS)

template_compile: template_compile_main.o log.o empty.o $(LIB)
	$(CC) $(LDFLAGS) -o template_compile log.o empty.o template_compile_main.o $(LIB)  $(BASE_LIBS)

template-set.make: template-set.make.in
	find_templates () { sed -rn 's/.*template_expand\("([^"]*)".*/\1/p' "$$@" | sort -u; };\
	format_variable () { (echo $$1 '='; shift; echo -n '  '$$@) | fmt -c | sed '$$!s/$$/ \\/'; };\
	(echo include $(PREFIX)/config.make; echo;\
	 format_variable TEMPLATES `find_templates ../../cmd/cmd_*`; echo;\
	 format_variable TEMPLATES_FRONTEND login `find_templates ../../servers/prayer*`; echo;\
	 cat template-set.make.in) > template-set.make

%.o: %.c Makefile
	$(CC) $(CFLAGS) -I../../lib -c $<

install:
	$(INSTALL) -o $(RO_USER) -g $(RO_GROUP) -m $(PUBLIC_DIR) \
	  -d $(BROOT)$(LIB_PREFIX) $(BROOT)$(PREFIX) $(BROOT)/usr/include/prayer
	$(INSTALL) -o $(RO_USER) -g $(RO_GROUP) -m $(PUBLIC_EXEC) \
	  template_compile template_expand build_index.pl makedeps.pl ${BROOT}${LIB_PREFIX}
	$(INSTALL) -o $(RO_USER) -g $(RO_GROUP) -m $(PUBLIC_FILE) \
	  ../../lib/*.h ${BROOT}/usr/include/prayer
	$(INSTALL) -o $(RO_USER) -g $(RO_GROUP) -m $(PUBLIC_FILE) \
	  template-set.make ${BROOT}$(PREFIX)
	$(INSTALL) -o $(RO_USER) -g $(RO_GROUP) -m $(PUBLIC_FILE) \
	  ../../Config ${BROOT}$(PREFIX)/config.make

clean:
	rm -f template_expand template_compile *.o *~ \#*\#