File: Makefile

package info (click to toggle)
flatpak 1.17.3-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 13,508 kB
  • sloc: ansic: 104,079; xml: 12,184; sh: 5,297; python: 2,315; yacc: 1,236; makefile: 84; csh: 20
file content (41 lines) | stat: -rw-r--r-- 1,402 bytes parent folder | download | duplicates (5)
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
PREFIX = /usr/local
CC ?= gcc
CFLAGS ?= -g -Wall
PKG_CONFIG ?= pkg-config
GLIB_CFLAGS = `$(PKG_CONFIG) --cflags glib-2.0`
GLIB_LIBS = `$(PKG_CONFIG) --libs glib-2.0`

all: sample ostree_test performance selftests

sample.h: variant-schema-compiler sample.gv
	./variant-schema-compiler --internal-validation --outfile sample-impl.h --outfile-header=sample.h --prefix=sample sample.gv

sample: sample.c sample.h
	$(CC) $(GLIB_CFLAGS) $(CFLAGS) -o sample sample.c $(GLIB_LIBS)

performance.h: variant-schema-compiler performance.gv
	./variant-schema-compiler --outfile performance.h --prefix=performance performance.gv

performance: performance.c performance.h
	$(CC) $(GLIB_CFLAGS) $(CFLAGS) -O2 -o performance performance.c $(GLIB_LIBS)

ostree_test.h: variant-schema-compiler ostree.gv
	./variant-schema-compiler --outfile ostree_test.h --prefix=ot ostree.gv

ostree_test: ostree_test.c ostree_test.h
	$(CC) $(GLIB_CFLAGS) $(CFLAGS) -o ostree_test ostree_test.c $(GLIB_LIBS)

selftests: selftests.c ostree_test.h
	$(CC) $(GLIB_CFLAGS) $(CFLAGS) -o selftests -O2 selftests.c $(GLIB_LIBS)

clean:
	rm -f sample.h sample performance.h performance ostree_test.h ostree_test

.PHONY: install
install: variant-schema-compiler
	mkdir -p $(DESTDIR)$(PREFIX)/bin
	install -T $< $(DESTDIR)$(PREFIX)/bin/variant-schema-compiler

.PHONY: uninstall
uninstall:
	rm -f $(DESTDIR)$(PREFIX)/bin/variant-schema-compiler