Rules.make 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # first found target
  2. first: pre default
  3. # create platform dirs
  4. ARCH_DIRS = $(ARCH_DISTDIR) $(ARCH_BINDIR) $(ARCH_INCDIR) $(ARCH_LIBDIR) \
  5. $(BIN) $(ETC) \
  6. $(DRIVERDIR) $(DBDRIVERDIR) $(FONTDIR) $(DOCSDIR) $(HTMLDIR) \
  7. $(MANBASEDIR) $(MANDIR) $(UTILSDIR)
  8. pre: | $(ARCH_DIRS)
  9. default:
  10. $(ARCH_DIRS):
  11. $(MKDIR) $@
  12. $(OBJDIR):
  13. -test -d $(OBJDIR) || $(MKDIR) $(OBJDIR)
  14. $(ARCH_INCDIR)/%.h: %.h
  15. $(INSTALL_DATA) $< $@
  16. ifneq ($(MINGW),)
  17. ifdef CROSS_COMPILING
  18. # build system is not MS Windows when cross-compiling
  19. mkpath = $(1):$(2)
  20. else
  21. ifeq ($(wildcard $(UTILSDIR)/g.echo$(EXE)),)
  22. # dummy path until g.echo.exe gets compiled and is needed
  23. mkpath = $(1);$(2)
  24. else
  25. mkpath = $(shell $(UTILSDIR)/g.echo$(EXE) $(1));$(2)
  26. endif
  27. endif
  28. else
  29. mkpath = $(1):$(2)
  30. endif
  31. GRASS_PYTHONPATH := $(call mkpath,$(GISBASE)/gui/wxpython,$$PYTHONPATH)
  32. GRASS_PYTHONPATH := $(call mkpath,$(GISBASE)/etc/python,$(GRASS_PYTHONPATH))
  33. ### really needed ???
  34. ### GRASS_PYTHONPATH := $(call mkpath,$(ARCH_DISTDIR)/etc/python,$(GRASS_PYTHONPATH))
  35. run_grass = \
  36. GISRC=$(RUN_GISRC) \
  37. GISBASE=$(RUN_GISBASE) \
  38. PATH="$(ARCH_DISTDIR)/bin:$(GISBASE)/bin:$(GISBASE)/scripts:$$PATH" \
  39. PYTHONPATH="$(GRASS_PYTHONPATH)" \
  40. $(LD_LIBRARY_PATH_VAR)="$(BIN):$(GISBASE)/bin:$(GISBASE)/scripts:$(ARCH_LIBDIR):$(BASE_LIBDIR):$($(LD_LIBRARY_PATH_VAR))" \
  41. LC_ALL=C LANG=C LANGUAGE=C \
  42. $(1)
  43. # default clean rules
  44. clean:
  45. -rm -rf $(OBJDIR) $(EXTRA_CLEAN_DIRS)
  46. -rm -f $(EXTRA_CLEAN_FILES) *.tab.[ch] *.yy.c *.output *.backup *.tmp.html *.pyc $(DEPFILE)
  47. -if [ "$(CLEAN_SUBDIRS)" != "" ] ; then \
  48. list='$(CLEAN_SUBDIRS)' ; \
  49. for dir in $$list ; do \
  50. $(MAKE) -C $$dir clean ; \
  51. done ; \
  52. fi
  53. depend:
  54. .PHONY: clean depend