--- a/Makefile
+++ b/Makefile
@@ -1,16 +1,17 @@
 
-LIBSRCS += hdhomerun_channels.c
-LIBSRCS += hdhomerun_channelscan.c
-LIBSRCS += hdhomerun_control.c
-LIBSRCS += hdhomerun_debug.c
-LIBSRCS += hdhomerun_device.c
-LIBSRCS += hdhomerun_device_selector.c
-LIBSRCS += hdhomerun_discover.c
-LIBSRCS += hdhomerun_os_posix.c
-LIBSRCS += hdhomerun_pkt.c
-LIBSRCS += hdhomerun_sock_posix.c
-LIBSRCS += hdhomerun_video.c
+LIBSRCS += hdhomerun_channels.o
+LIBSRCS += hdhomerun_channelscan.o
+LIBSRCS += hdhomerun_control.o
+LIBSRCS += hdhomerun_debug.o
+LIBSRCS += hdhomerun_device.o
+LIBSRCS += hdhomerun_device_selector.o
+LIBSRCS += hdhomerun_discover.o
+LIBSRCS += hdhomerun_os_posix.o
+LIBSRCS += hdhomerun_pkt.o
+LIBSRCS += hdhomerun_sock_posix.o
+LIBSRCS += hdhomerun_video.o
 
+AR    := $(CROSS_COMPILE)ar
 CC    := $(CROSS_COMPILE)gcc
 STRIP := $(CROSS_COMPILE)strip
 
@@ -38,14 +39,17 @@ else
   endif
 endif
 
-all : hdhomerun_config$(BINEXT) libhdhomerun$(LIBEXT)
+all : hdhomerun_config$(BINEXT) libhdhomerun.a
+
+%.o: %.c
+	$(CC) $(CFLAGS) -fPIC -c -o $@ $<
 
 hdhomerun_config$(BINEXT) : hdhomerun_config.c $(LIBSRCS)
 	$(CC) $(CFLAGS) $+ $(LDFLAGS) -o $@
 	$(STRIP) $@
 
-libhdhomerun$(LIBEXT) : $(LIBSRCS)
-	$(CC) $(CFLAGS) -fPIC -DDLL_EXPORT $(SHARED) $+ $(LDFLAGS) -o $@
+libhdhomerun.a : $(LIBSRCS)
+	$(AR) rcs libhdhomerun.a $(LIBSRCS)
 
 clean :
 	-rm -f hdhomerun_config$(BINEXT)
