summaryrefslogtreecommitdiff
path: root/dist/examples/cxx/parser/generated/makefile
blob: b7bb4b83f4a88cfa7f76ee9092093c93d382c51f (plain)
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
root := ../../..

include $(root)/build/cxx/rules.make
include $(root)/build/xsd/parser-rules.make

override XSDFLAGS += --generate-print-impl --generate-test-driver

# If you are basing your own code on this example and make changes
# to the sample implementation and/or test driver, make sure you
# remove this option or your changes will be lost forever.
#
override XSDFLAGS += --force-overwrite

# Build
#
library-driver: library-driver.o library-pskel.o library-pimpl.o

library-driver.o: library-driver.cxx library-pimpl.hxx library-pskel.hxx
library-pimpl.o: library-pimpl.cxx library-pimpl.hxx library-pskel.hxx
library-pskel.o: library-pskel.cxx library-pskel.hxx

library-pskel.hxx  \
library-pskel.cxx  \
library-pimpl.hxx  \
library-pimpl.cxx  \
library-driver.cxx : library.xsd

# Change the pattern rule from parser-rules.make to include the sample
# implementation and test driver.
#
.PRECIOUS: %-pskel.hxx %-pskel.cxx %-pimpl.hxx %-pimpl.cxx %-driver.cxx

%-pskel.hxx %-pskel.cxx %-pimpl.hxx %-pimpl.cxx %-driver.cxx: %.xsd
	$(XSD) cxx-parser $(XSDFLAGS) $<


# Test.
#
.PHONY: test
test: library-driver library.xml
	./library-driver library.xml


# Clean.
#
.PHONY: clean
clean:
	rm -f library-driver.?xx library-pimpl.?xx library-pskel.?xx
	rm -f library-driver.o library-pimpl.o library-pskel.o library-driver