mpath=C:\Progra~1\CodeBlocks.old

CC:=$(mpath)/bin/gcc
rc:=$(mpath)/bin/windres.exe
CFLAGS:=-O2 -Wall -DBUILD_DLL 
IFLAGS:=

all: ihook.dll mainw main

mainw: mainw.o mainw.res
	$(CC) $^ -o $@ -mwindows -L. -lihook
        
clean:
	rm -rf *.core *.o *.res *.a

remake: clean all

main: main.o
	$(CC) $^ -o $@ -L. -lihook

ihook.dll: ihook.o
	$(CC) -Wl,--out-implib=libihook.a -Wl,--dll $(lib) $^ -o $@ -s -lgdi32 -mdll

.c.o:
	$(CC) $(CFLAGS) $(IFLAGS) -c $^ -o $@
        
%.res: %.rc
	$(rc) -i $^ -J rc -o $@ -O coff
