Home | History | Annotate | Download | only in ruby
      1 
      2 
      3 ifeq ($(NEOTONIC_ROOT),)
      4 NEOTONIC_ROOT = ..
      5 endif
      6 
      7 include $(NEOTONIC_ROOT)/rules.mk
      8 
      9 all: config.save ext/hdf/hdf.so testrb
     10 
     11 config.save: install.rb
     12 	$(RUBY) install.rb config -- --with-hdf-include=../../.. --with-hdf-lib=../../../libs --make-prog=$(MAKE)
     13 
     14 ext/hdf/Makefile:
     15 	$(RUBY) install.rb config -- --with-hdf-include=../../.. --with-hdf-lib=../../../libs --make-prog=$(MAKE)
     16 
     17 ext/hdf/hdf.so: config.save
     18 	$(RUBY) install.rb setup 
     19 
     20 gold: ext/hdf/hdf.so
     21 	$(RUBY) -Ilib -Iext/hdf test/hdftest.rb > hdftest.gold;
     22 	@echo "Generated gold files"
     23 
     24 testrb: 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 
     43 install: all
     44 	$(RUBY) install.rb install
     45 
     46 clean:
     47 	$(RM) ext/hdf/*.o ext/hdf/*.so
     48 
     49 distclean:
     50 	$(RM) Makefile.depends config.save ext/hdf/hdf.so
     51 	$(RM) ext/hdf/Makefile ext/hdf/mkmf.log ext/hdf/*.o
     52