File: Makefile

package info (click to toggle)
postgresql-numeral 1.3-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 196 kB
  • sloc: ansic: 370; yacc: 242; sql: 194; lex: 169; makefile: 37; sh: 19
file content (43 lines) | stat: -rw-r--r-- 1,254 bytes parent folder | download | duplicates (3)
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
MODULE_big = numeral
OBJS = numeral.o \
	   numeralfuncs.o numerallexer.yy.o numeralparser.tab.o \
	   zahlfuncs.o zahllexer.yy.o zahlparser.tab.o \
	   romanfuncs.o romanlexer.yy.o romanparser.tab.o
EXTENSION = numeral
DATA_built = numeral--1.sql
REGRESS = extension numeral zahl roman operator
EXTRA_CLEAN = *.yy.* *.tab.*

PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)

INCLUDEDIR_SERVER = $(shell $(PG_CONFIG) --includedir-server)
# FLOAT8PASSBYVAL is derived from SIZEOF_VOID_P
SIZEOF_VOID_P = $(shell grep '^.define SIZEOF_VOID_P' $(INCLUDEDIR_SERVER)/pg_config.h | cut -d ' ' -f 3)
ifeq ($(SIZEOF_VOID_P),8)
PASSEDBYVALUE = passedbyvalue,
endif

numeral.o: numeral.c numeral.h

%.yy.c: %.l
	flex -o $@ $<

numerallexer.yy.o: numeral.h numeralparser.tab.c # actually numeralparser.tab.h
zahllexer.yy.o: numeral.h zahlparser.tab.c # actually zahlparser.tab.h
romanlexer.yy.o: numeral.h romanparser.tab.c # actually romanparser.tab.h

%.tab.c: %.y
	bison -d $<

numeralparser.tab.o: numeral.h
zahlparser.tab.o: numeral.h
romanparser.tab.o: numeral.h

# extension sql
%.sql: %.sql.in
	set -e; \
	for type in numeral zahl roman; do \
		sed -e "s/@TYPE@/$$type/g" -e "s/@PASSEDBYVALUE@/$(PASSEDBYVALUE)/" < $<; \
	done > $@