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
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 $<