--- a/Makefile
+++ b/Makefile
@@ -3,6 +3,7 @@
 OS := $(shell uname -s)
 endif
 
+AR    := $(CROSS_COMPILE)ar
 CC    := $(CROSS_COMPILE)gcc
 STRIP := $(CROSS_COMPILE)strip
 
@@ -26,19 +27,19 @@
   LDFLAGS += -lrt
 endif
 
-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.c
-LIBSRCS += hdhomerun_sock_posix.c
-LIBSRCS += hdhomerun_sock_$(IF_DETECT).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.o
+LIBSRCS += hdhomerun_sock_posix.o
+LIBSRCS += hdhomerun_sock_$(IF_DETECT).o
+LIBSRCS += hdhomerun_video.o
 
 ifeq ($(OS),Darwin)
 
@@ -69,14 +70,17 @@
 
 else
 
-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) -DDLL_EXPORT -fPIC $(SHARED) $+ $(LDFLAGS) -o $@
+libhdhomerun.a : $(LIBSRCS)
+	$(AR) rcs libhdhomerun.a $(LIBSRCS)
 
 endif
 
