FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Makefile for FWH and MinGW gcc
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Makefile for FWH and MinGW gcc
Posted: Wed Sep 24, 2008 11:09 AM
Here you have a first prototype of a Makefile for FWH and gcc.

Please notice that the "M" has to be uppercase. To build it just do: c:\mingw\bin\mingw32-make.exe. To easy it, we have created a make.bat file that just calls to c:\mingw\bin\mingw32-make.exe. Also notice that "left spaces" are "tabs" and not "spaces".

The plan is to build an EXE from one.prg, two.prg and three.c (the third one is a C file that we want to include in the EXE). We are not building the EXE from this Makefile yet. Just compiling all the PRGs and C modules.

Makefile
# gcc make example for Windows, developed by FiveTech Software

all : test.exe

PRG_OBJS = ./obj/one.c  \
					 ./obj/two.c

C_OBJS = ./obj/one.o \
         ./obj/two.o \
         ./obj/three.o

test.exe : $(PRG_OBJS) $(C_OBJS)

./obj/%.c : %.prg
	if not exist obj mkdir obj
	c:\harbour\source\main\w32\mingw32\harbour.exe $< -o$@ -n -Ic:\harbour\include -Ic:\fwh\include
	
./obj/%.o : ./obj/%.c
	gcc -c -o$@ -Ic:\harbour\include $<	
	
./obj/%.o : %.c
	gcc -c -o$@ -Ic:\harbour\include $<
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Makefile for FWH and MinGW gcc
Posted: Wed Sep 24, 2008 11:25 AM
make.bat
set oldpath=%path%
set path=c:\mingw\bin;%path%
c:\mingw\bin\mingw32-make.exe
set path=%oldpath%
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Makefile for FWH and MinGW gcc
Posted: Sun Sep 28, 2008 08:16 AM
A new Makefile version that already builds the EXE:

Makefile
# gcc make example for Windows, developed by FiveTech Software 

hdir=c:\harbour 
hdirc=$(hdir)\source\main\w32\mingw32\harbour.exe 
hlibs=$(hdir)\lib\w32\mingw32 
fwh=c:\fwh 
mingw=c:\mingw 

all : test.exe 
   test.exe 

PRG_OBJS = ./obj/one.c  \ 
                ./obj/two.c 

C_OBJS = ./obj/one.o \ 
         ./obj/two.o \ 
         ./obj/three.o 

test.exe : $(PRG_OBJS) $(C_OBJS) 
   if not exist one.rc $(mingw)\bin\gcc -otest.exe ./obj/one.o ./obj/two.o ./obj/three.o -Wall -s -mwindows -L$(mingw)\lib -L$(hlibs) -L$(fwh)\lib -mno-cygwin -Wl,--start-group -lfivehg -lfivehgc -lgtgui -ldll -lsocket -luser32 -lwinspool -lcomctl32 -lcomdlg32 -lgdi32 -lole32 -loleaut32 -luuid -lwinmm -lvfw32 -lwsock32 -lmsimg32 -lhbbtree -lhbclipsm -lhbcommon -lhbcpage -lhbcplr -lhbct -lhbcurl -lhbfbird -lhbgd -lhbhpdf -lhbhsx -lhblang -lhbmacro -lhbmainstd -lhbmisc -lhbmsql -lhbmysql -lmysqldll -lhbmzip -lhbnf -lhbodbc -lodbc32 -lhbpcre -lhbpgsql -lhbpp -lhbrdd -lhbrtl -lhbsix -lhbsqlit3 -lhbtip -lhbusrrdd -lhbvm -lhbvpdf -lhbw32 -lhbzlib -lrddado -lrddads -lrddcdx -lrddfpt -lrddntx -lxhb -Wl,--end-group 
   if exist one.rc $(mingw)\bin\gcc -otest.exe ./obj/one.o ./obj/two.o ./obj/three.o _one.o -Wall -s -mwindows -L$(mingw)\lib -L$(hlibs) -L$(fwh)\lib -mno-cygwin -Wl,--start-group -lfivehg -lfivehgc -lgtgui -ldll -lsocket -luser32 -lwinspool -lcomctl32 -lcomdlg32 -lgdi32 -lole32 -loleaut32 -luuid -lwinmm -lvfw32 -lwsock32 -lmsimg32 -lhbbtree -lhbclipsm -lhbcommon -lhbcpage -lhbcplr -lhbct -lhbcurl -lhbfbird -lhbgd -lhbhpdf -lhbhsx -lhblang -lhbmacro -lhbmainstd -lhbmisc -lhbmsql -lhbmysql -lmysqldll -lhbmzip -lhbnf -lhbodbc -lodbc32 -lhbpcre -lhbpgsql -lhbpp -lhbrdd -lhbrtl -lhbsix -lhbsqlit3 -lhbtip -lhbusrrdd -lhbvm -lhbvpdf -lhbw32 -lhbzlib -lrddado -lrddads -lrddcdx -lrddfpt -lrddntx -lxhb -Wl,--end-group 

./obj/%.c : %.prg 
   if not exist obj mkdir obj 
   $(hdir)\source\main\w32\mingw32\harbour.exe $< -o$@ -n -I$(hdir)\include -I$(fwh)\include 
    
./obj/%.o : ./obj/%.c 
   gcc -c -o$@ -I$(hdir)\include $<    
    
./obj/%.o : %.c 
   gcc -c -o$@ -I$(hdir)\include $<
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Make-file Test
Posted: Sun Sep 28, 2008 05:15 PM
Antonio,

I tested the make file, but it didn't work.
My only changes => c: to d: and filenames.
The used files : brwtools.prg, errsysw.prg and brwtools.rc

My call : Make project
--------------------------



The batch-file MAKE.BAT :
------------------------------

set oldpath=%path% 
set path=d:\mingw\bin;%path% 
d:\mingw\bin\mingw32-make.exe 
set path=%oldpath% 

The Make-file PROJECT.RMK :
----------------------------------

# gcc make example for Windows, developed by FiveTech Software 

hdir=d:\harbour 
hdirc=$(hdir)\source\main\w32\mingw32\harbour.exe 
hlibs=$(hdir)\lib\w32\mingw32 
fwh=d:\fwh 
mingw=d:\mingw 

all : brwtools.exe 
   brwtools.exe 

PRG_OBJS = ./obj/brwtools.c  \ 
                ./obj/errsysw.c 

C_OBJS = ./obj/brwtools.o \ 
                  ./obj/errsysw.o 

brwtools.exe : $(PRG_OBJS) $(C_OBJS) 
if not exist brwtools.rc $(mingw)\bin\gcc -o brwtools.exe ./obj/brwtools.o ./obj/errsysw.o -Wall -s -mwindows -L$(mingw)\lib -L$(hlibs) -L$(fwh)\lib -mno-cygwin -Wl,--start-group -lfivehg -lfivehgc -lgtgui -ldll -lsocket -luser32 -lwinspool -lcomctl32 -lcomdlg32 -lgdi32 -lole32 -loleaut32 -luuid -lwinmm -lvfw32 -lwsock32 -lmsimg32 -lhbbtree -lhbclipsm -lhbcommon -lhbcpage -lhbcplr -lhbct -lhbcurl -lhbfbird -lhbgd -lhbhpdf -lhbhsx -lhblang -lhbmacro -lhbmainstd -lhbmisc -lhbmsql -lhbmysql -lmysqldll -lhbmzip -lhbnf -lhbodbc -lodbc32 -lhbpcre -lhbpgsql -lhbpp -lhbrdd -lhbrtl -lhbsix -lhbsqlit3 -lhbtip -lhbusrrdd -lhbvm -lhbvpdf -lhbw32 -lhbzlib -lrddado -lrddads -lrddcdx -lrddfpt -lrddntx -lxhb -Wl,--end-group 
if exist brwtools.rc $(mingw)\bin\gcc -o brwtools.exe ./obj/brwtools.o ./obj/errsysw.o _one.o -Wall -s -mwindows -L$(mingw)\lib -L$(hlibs) -L$(fwh)\lib -mno-cygwin -Wl,--start-group -lfivehg -lfivehgc -lgtgui -ldll -lsocket -luser32 -lwinspool -lcomctl32 -lcomdlg32 -lgdi32 -lole32 -loleaut32 -luuid -lwinmm -lvfw32 -lwsock32 -lmsimg32 -lhbbtree -lhbclipsm -lhbcommon -lhbcpage -lhbcplr -lhbct -lhbcurl -lhbfbird -lhbgd -lhbhpdf -lhbhsx -lhblang -lhbmacro -lhbmainstd -lhbmisc -lhbmsql -lhbmysql -lmysqldll -lhbmzip -lhbnf -lhbodbc -lodbc32 -lhbpcre -lhbpgsql -lhbpp -lhbrdd -lhbrtl -lhbsix -lhbsqlit3 -lhbtip -lhbusrrdd -lhbvm -lhbvpdf -lhbw32 -lhbzlib -lrddado -lrddads -lrddcdx -lrddfpt -lrddntx -lxhb -Wl,--end-group 

./obj/%.c : %.prg 
if not exist obj mkdir obj 
$(hdir)\source\main\w32\mingw32\harbour.exe $< -o$@ -n -I$(hdir)\include -I$(fwh)\include 
    
./obj/%.o : ./obj/%.c 
gcc -c -o$@ -I$(hdir)\include $<    
    
./obj/%.o : %.c 
gcc -c -o$@ -I$(hdir)\include $<


Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Makefile for FWH and MinGW gcc
Posted: Sun Sep 28, 2008 06:15 PM

Uwe,

Your make file has to be named "Makefile" (notice the first uppercase).

And you call make.bat (the one that I published) with no parameters

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
RMAKE
Posted: Sun Sep 28, 2008 07:56 PM

Antonio,

I changed the file-names to :

Go.bat
Makefile.rmk

I called just Go
I tested with Go Makefile

It was allways the same ( see Dos-Message.box ).
It seems, Mingw32-make.exe cannot connect to Makefile.rmk.
Could be maybe a path-define-problem.

My installs :

D:\FWH
D:\HARBOUR
D:\MINGW

My files : http://www.pflegeplus.com/fw_downloads/TestMinGW.zip

Regards
Uwe :lol:

Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Makefile for FWH and MinGW gcc
Posted: Sun Sep 28, 2008 09:47 PM

Uwe,

> Makefile.rmk

No! :-)

Please rename Makefile.rmk into Makefile

No extension! :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion