Ver Fonte

* Small tool to regenerate fpcmake.inc. Execute "make regenerateinc" to use

Michaël Van Canneyt há 2 anos atrás
pai
commit
fb5d9285e3
2 ficheiros alterados com 46 adições e 0 exclusões
  1. 16 0
      utils/fpcm/Makefile
  2. 30 0
      utils/fpcm/regeninc.pp

+ 16 - 0
utils/fpcm/Makefile

@@ -6,3 +6,19 @@ $(BS_UNITDIR):
 bootstrap: $(BS_UNITDIR) fpcmake.inc
 	$(FPCFPMAKE) fpcmake.pp $(FPMAKE_SKIP_CONFIG) -Fu$(UNITDIR_FPMAKE_RTL) -FU$(BS_UNITDIR) $(OPT)
 endif
+
+regeninc$(EXEEXT): regeninc.pp
+ifdef INSTALLEDCOMPILER
+	$(FPC) $<
+else	
+	$(COMPILER) $<
+endif
+
+regenerateinc: regeninc$(EXEEXT)
+ifdef inUnix
+	./regeninc
+else
+        regeninc$(EXEEXT)
+endif	
+
+	

+ 30 - 0
utils/fpcm/regeninc.pp

@@ -0,0 +1,30 @@
+program regeninc;
+
+uses Sysutils;
+
+const
+  data2incname = 'data2inc';
+  ininame = 'fpcmake.ini';
+  incname = 'fpcmake.inc';
+  constname = 'fpcmakeini';
+  
+var
+  Data2Inc : string;
+  res : integer;
+
+begin
+  Data2Inc:=ExeSearch('data2inc',GetEnvironmentVariable('PATH'));
+  if Data2Inc='' then
+    begin
+    Writeln('Data2inc not found');
+    Halt(1);
+    end;
+  if not FileExists(ininame) then
+    begin
+    Writeln('file ',ininame,' not found, this file must be in the current directory');
+    Halt(2);
+    end;
+  Res:=ExecuteProcess(data2inc,['-b','-s',ininame,incname,constname]);
+  if Res<>0 then 
+    Halt(Res);
+end.