# # Makefile.fpc for FP IDE # [target] # this will be undefined when the fake compiler is used dirs=compiler programs=fp rst=fpstrings [install] datadir=$(INSTALL_BASEDIR)/ide fpcpackage=y [compiler] options=-Sg targetdir=. unitdir=$(COMPILERDIR) [require] packages=fv gdbint [default] fpcdir=../.. [prerules] ifeq ($(OS_TARGET),linux) ifneq ($(findstring 1.0.,$(FPC_VERSION)),) override FPCOPT+=-dUNIX endif endif ifeq ($(OS_TARGET),freebsd) ifneq ($(findstring 1.0.,$(FPC_VERSION)),) override FPCOPT+=-dUNIX endif endif # Compiler dir #ifdef FAKE #COMPILERDIR=../fake/compiler #else COMPILERDIR=compiler #endif # when including debugger include the gdbinterface ifndef GDBINT GDBINT=gdbint endif # Try to find GDB library ifeq ($(GDB),1) ifeq ($(DEBUG),1) # First test if a debug version exists in a specific dir ifneq ($(strip $(wildcard $(PACKAGESDIR)/$(GDBINT)/libgdb/d$(OS_TARGET)/libgdb.a)),) OSGDBDIR=d$(OS_TARGET) else OSGDBDIR=$(OS_TARGET) endif else OSGDBDIR=$(OS_TARGET) endif GDBLIBDIR+=$(wildcard $(addsuffix /$(GDBINT)/libgdb/$(OSGDBDIR),$(PACKAGESDIR))) GDBOBJDIR+=$(wildcard $(addsuffix /$(GDBINT)/libgdb/$(OSGDBDIR),$(PACKAGESDIR))) ifeq ($(OS_TARGET),go32v2) ifneq ($(DJDIR),) GDBLIBDIR+=$(DJDIR)/lib endif endif ifeq ($(strip $(wildcard $(addsuffix /libgdb.a,$(GDBLIBDIR)))),) override GDB=0 GDBFOUND=0 else override LIBGDB=$(firstword $(wildcard $(addsuffix /libgdb.a,$(GDBLIBDIR)))) GDBFOUND=1 endif endif ifeq ($(GDB),1) # The gdbint is already included due the gdbint package dependency override LIBDIR+=$(GDBLIBDIR) override OBJDIR+=$(GDBOBJDIR) else override UNITDIR+=../fake/gdb endif [rules] .PHONY: compilerunits compilerclean \ fake fakegdb gdb full fullgdb \ clean_compiler clean testgdb postgdbinfo clean: fpc_cleanall distclean: clean compilerclean fp$(EXEEXT): $(wildcard *.pas) $(wildcard *.inc) testgdb: ifneq ($(GDBFOUND),0) @$(ECHO) LibGDB found in $(LIBGDB) else @$(ECHO) LibGDB not found @$(ECHO) LIBGDB=$(LIBGDB) @$(ECHO) GDBLIBDIR=$(GDBLIBDIR) @$(ECHO) $(wildcard $(addsuffix /libgdb.a,$(GDBLIBDIR))) endif postgdbinfo: ifeq ($(GDBFOUND),0) @$(ECHO) LibGDB was not found, IDE has no Debugger support endif # # Compiler # compilerunits : $(COMPILERDIR)/$(FPCMADE) $(COMPILERDIR)/$(FPCMADE): $(MAKE) -C $(COMPILERDIR) all compilerclean : $(MAKE) -C $(COMPILERDIR) clean # # Default targets # all: compilerunits fpc_all gdb: $(MAKE) testgdb all GDB=1 postgdbinfo # # Fake targets # fakegdb: $(MAKE) testgdb all FAKE=1 GDB=1 postgdbinfo fake: $(MAKE) all FAKE=1 # # Compatibility targets # full: all fullgdb: gdb # This is necessary because we don't have all units separate in the # units targets clean: cleanall # # Installation # ifndef UNIXINSTALLDIR override INSTALL_DATADIR=$(INSTALL_BINDIR) endif install: fpc_install $(MKDIR) $(INSTALL_DATADIR) $(MKDIR) $(INSTALL_DOCDIR) $(INSTALL) fp.ans $(wildcard *.pt) $(wildcard *.tdf) $(INSTALL_DATADIR) $(INSTALL) readme.ide $(INSTALL_DOCDIR) # # Misc # clean_compiler: $(MAKE) -C ../../compiler clean