Browse Source

* gecho support
* use foreach to write fpcext.cmd
* add fpcext.cmd to clean targets

peter 25 years ago
parent
commit
c8b298b9ac
3 changed files with 318 additions and 294 deletions
  1. 224 214
      utils/fpcmake.inc
  2. 83 75
      utils/fpcmake.ini
  3. 11 5
      utils/fpcmake.pp

File diff suppressed because it is too large
+ 224 - 214
utils/fpcmake.inc


+ 83 - 75
utils/fpcmake.ini

@@ -58,17 +58,6 @@ else
 SEARCHPATH=$(subst ;, ,$(PATH))
 endif
 
-# echo
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-
 # Base dir
 ifdef PWD
 BASEDIR:=$(shell $(PWD))
@@ -312,6 +301,81 @@ override REDIR:= >> $(REDIRFILE)
 endif
 
 
+[shelltools]
+#####################################################################
+# Shell tools
+#####################################################################
+
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+
+# To copy pograms
+ifndef COPY
+COPY:=cp -fp
+endif
+
+# Copy a whole tree
+ifndef COPYTREE
+COPYTREE:=cp -rfp
+endif
+
+# To move pograms
+ifndef MOVE
+MOVE:=mv -f
+endif
+
+# Check delete program
+ifndef DEL
+DEL:=rm -f
+endif
+
+# Check deltree program
+ifndef DELTREE
+DELTREE:=rm -rf
+endif
+
+# To install files
+ifndef INSTALL
+ifdef inlinux
+INSTALL:=install -m 644
+else
+INSTALL:=$(COPY)
+endif
+endif
+
+# To install programs
+ifndef INSTALLEXE
+ifdef inlinux
+INSTALLEXE:=install -m 755
+else
+INSTALLEXE:=$(COPY)
+endif
+endif
+
+# To make a directory.
+ifndef MKDIR
+ifdef inlinux
+MKDIR:=install -m 755 -d
+else
+MKDIR:=ginstall -m 755 -d
+endif
+endif
+
+export ECHO COPY COPYTREE MOVE DEL DELTREE INSTALL INSTALLEXE MKDIR
+
+
 [command_begin]
 #####################################################################
 # Compiler Command Line
@@ -437,75 +501,19 @@ override FPCOPT+=@$(CFGFILE)
 endif
 
 # For win32 the options are passed using the file fpcext.cmd
+ifndef FPCEXTCMD
+FPCEXTCMD=fpcext.cmd
+endif
 ifeq ($(OS_SOURCE),win32)
-override TMPVAR:=$(shell "$(ECHO) -e $(addprefix "\n",$(FPCOPT)) > fpcext.cmd")
-override FPCOPT:[email protected]
+override TMPVAR:=$(shell "$(DEL) $(FPCEXTCMD)")
+override TMPVAR:=$(foreach A,$(FPCOPT),$(shell "$(ECHO) $(A) >> $(FPCEXTCMD)"))
+override FPCOPT:=@$(FPCEXTCMD)
 endif
 
 # Compiler commandline
 override COMPILER:=$(FPC) $(FPCOPT)
 
 
-[shelltools]
-#####################################################################
-# Shell tools
-#####################################################################
-
-# To copy pograms
-ifndef COPY
-COPY:=cp -fp
-endif
-
-# Copy a whole tree
-ifndef COPYTREE
-COPYTREE:=cp -rfp
-endif
-
-# To move pograms
-ifndef MOVE
-MOVE:=mv -f
-endif
-
-# Check delete program
-ifndef DEL
-DEL:=rm -f
-endif
-
-# Check deltree program
-ifndef DELTREE
-DELTREE:=rm -rf
-endif
-
-# To install files
-ifndef INSTALL
-ifdef inlinux
-INSTALL:=install -m 644
-else
-INSTALL:=$(COPY)
-endif
-endif
-
-# To install programs
-ifndef INSTALLEXE
-ifdef inlinux
-INSTALLEXE:=install -m 755
-else
-INSTALLEXE:=$(COPY)
-endif
-endif
-
-# To make a directory.
-ifndef MKDIR
-ifdef inlinux
-MKDIR:=install -m 755 -d
-else
-MKDIR:=ginstall -m 755 -d
-endif
-endif
-
-export COPY COPYTREE MOVE DEL DELTREE INSTALL INSTALLEXE MKDIR
-
-
 [tool_default]
 #####################################################################
 # Default Tools
@@ -1132,7 +1140,7 @@ endif
 ifdef EXTRACLEANFILES
         -$(DEL) $(EXTRACLEANFILES)
 endif
-        -$(DEL) $(FPCMADE) $(PPAS) link.res $(REDIRFILE)
+        -$(DEL) $(FPCMADE) $(PPAS) link.res $(FPCEXTCMD) $(REDIRFILE)
 
 fpc_cleanall: $(CLEANTARGET)
 ifdef CLEANEXEFILES
@@ -1140,7 +1148,7 @@ ifdef CLEANEXEFILES
 endif
         -$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
         -$(DELTREE) *$(SMARTEXT)
-        -$(DEL) $(FPCMADE) $(PPAS) link.res $(REDIRFILE)
+        -$(DEL) $(FPCMADE) $(PPAS) link.res $(FPCEXTCMD) $(REDIRFILE)
 
 
 [dependrules]

+ 11 - 5
utils/fpcmake.pp

@@ -692,13 +692,12 @@ var
     packagedir:='$(PACKAGEDIR_'+VarName(s)+')';
     mf.Add('ifdef PACKAGE'+VarName(s));
     mf.Add('ifneq ($(wildcard '+packagedir+'),)');
-    mf.Add('ifeq ($(wildcard '+packagedir+'/$(FPCMADE)),)');
     mf.Add('override COMPILEPACKAGES+='+s);
-    mf.Add(s+'_package:');
+    mf.Add(s+'_package: '+packagedir+'/$(FPCMADE)');
+    mf.Add(packagedir+'/$(FPCMADE):');
     mf.Add(#9'$(MAKE) -C '+packagedir+' all');
     mf.Add('endif');
     mf.Add('endif');
-    mf.Add('endif');
     Phony:=Phony+' '+s+'_package';
   end;
 
@@ -955,6 +954,9 @@ begin
    { redirection }
      AddSection(true,'redir');
 
+   { shell tools like copy,del,echo }
+     AddSection(userini.section[sec_command] or userini.section[sec_tools],'shelltools');
+
    { commandline }
      if userini.section[sec_command] then
       begin
@@ -981,7 +983,6 @@ begin
    { write tools }
      if userini.section[sec_tools] then
       begin
-        AddSection(true,'shelltools');
         AddSection(true,'tool_default');
         AddSection(userini.toolsppdep,'tool_ppdep');
         AddSection(userini.toolsppumove,'tool_ppumove');
@@ -1133,7 +1134,12 @@ begin
 end.
 {
   $Log$
-  Revision 1.22  2000-01-10 22:55:49  peter
+  Revision 1.23  2000-01-12 23:20:37  peter
+    * gecho support
+    * use foreach to write fpcext.cmd
+    * add fpcext.cmd to clean targets
+
+  Revision 1.22  2000/01/10 22:55:49  peter
     * zipname creation from packagename
 
   Revision 1.21  2000/01/08 16:31:04  peter

Some files were not shown because too many files changed in this diff