OUTS:= clienti2c32.dll clienti2c.so parent parent.exe all : $(OUTS) SRCS:=clienti2c.c os_generic.c CFLAGS:=-Os #MINGW:=/usr/bin/i586-mingw32msvc- MINGW:=/usr/bin/x86_64-w64-mingw32- MINGW32:=/usr/bin/i686-w64-mingw32- CFLAGS:=-Ilibusb/include -g -fPIC WINLDFLAGS:=libusb/libusb.a LINLDFLAGS:=-lusb -lpthread clienti2c32.dll : $(SRCS) $(MINGW32)gcc $(CFLAGS) -m32 -shared -o $@ $^ $(WINLDFLAGS) %.exe : %.c os_generic.c $(MINGW32)gcc $(CFLAGS) -m32 -o $@ $^ ./clienti2c32.dll clienti2c.so : $(SRCS) gcc $(CFLAGS) -o $@ $^ -shared $(LINLDFLAGS) #parent : parent.c os_generic.c ./clienti2c.so # gcc $(CFLAGS) -o $@ $^ ./clienti2c.so % : %.c os_generic.c gcc $(CFLAGS) -o $@ $^ ./clienti2c.so $(LINLDFLAGS) clean : rm -rf $(OUTS) *~ *.o *.exe