• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1
2
3ifeq ($(NEOTONIC_ROOT),)
4NEOTONIC_ROOT = ..
5endif
6
7include $(NEOTONIC_ROOT)/rules.mk
8
9all: config.save ext/hdf/hdf.so testrb
10
11config.save: install.rb
12	$(RUBY) install.rb config -- --with-hdf-include=../../.. --with-hdf-lib=../../../libs --make-prog=$(MAKE)
13
14ext/hdf/Makefile:
15	$(RUBY) install.rb config -- --with-hdf-include=../../.. --with-hdf-lib=../../../libs --make-prog=$(MAKE)
16
17ext/hdf/hdf.so: config.save
18	$(RUBY) install.rb setup
19
20gold: ext/hdf/hdf.so
21	$(RUBY) -Ilib -Iext/hdf test/hdftest.rb > hdftest.gold;
22	@echo "Generated gold files"
23
24testrb: ext/hdf/hdf.so
25	@echo "Running ruby test"
26	@failed=0; \
27	rm -f hdftest.out; \
28	$(RUBY) -Ilib -Iext/hdf test/hdftest.rb > hdftest.out; \
29	diff --brief hdftest.out hdftest.gold > /dev/null 2>&1; \
30	return_code=$$?; \
31	if [ $$return_code -ne 0 ]; then \
32	  diff hdftest.out hdftest.gold > hdftest.err; \
33	  echo "Failed Ruby Test: hdftest.rb"; \
34	  echo "    See hdftest.out and hdftest.err"; \
35	  failed=1; \
36	fi; \
37	if [ $$failed -eq 1 ]; then \
38	  exit 1; \
39	fi;
40	@echo  "Passed ruby test"
41
42
43install: all
44	$(RUBY) install.rb install
45
46clean:
47	$(RM) ext/hdf/*.o ext/hdf/*.so
48
49distclean:
50	$(RM) Makefile.depends config.save ext/hdf/hdf.so
51	$(RM) ext/hdf/Makefile ext/hdf/mkmf.log ext/hdf/*.o
52