diff options
Diffstat (limited to 'unix/Makefile')
-rw-r--r-- | unix/Makefile | 43 |
1 files changed, 28 insertions, 15 deletions
diff --git a/unix/Makefile b/unix/Makefile index 0e27cc1..ffe9d6c 100644 --- a/unix/Makefile +++ b/unix/Makefile @@ -1,7 +1,7 @@ ######################################################################### # -# $Id: Makefile 1.4 2011/04/18 08:08:41 martin REL_M $ +# $Id: Makefile 1.7 2014/10/30 13:50:04 martin TRASH $ # # Description: # Makefile for gpsxmple for Unix-like systems. @@ -9,6 +9,12 @@ # # ----------------------------------------------------------------------- # $Log: Makefile $ +# Revision 1.7 2014/10/30 13:50:04 martin +# Added module mbgerror.o. +# Revision 1.6 2013/02/01 16:11:27 martin +# Added extiohlp module to the list of object files. +# Revision 1.5 2011/08/19 07:26:40 martin +# Modified the way to define targets etc. # Revision 1.4 2011/04/18 08:08:41 martin # Modified DEBUG handling. # Revision 1.3 2009/10/01 14:09:19 martin @@ -28,8 +34,19 @@ TARGET = gpsxmple MBGLIB = ../mbglib -MBGLIB_COMMON=$(MBGLIB)/common -LOC_INCL = -I. -I $(MBGLIB_COMMON) +MBGLIB_DIRS += common + +VPATH += .. +VPATH += $(foreach dir,$(MBGLIB_DIRS),$(MBGLIB)/$(dir)) + +OBJS = $(TARGET).o +OBJS += extiohlp.o +OBJS += mbgextio.o +OBJS += mbgserio.o +OBJS += gpsserio.o +OBJS += gpsutils.o +OBJS += aes128.o +OBJS += mbgerror.o # Try to determine whether the OS is QNX @@ -38,7 +55,7 @@ OS_IS_QNX := $(shell uname | grep -i QNX && echo "QNX" ) # set up the compiler flags -CFLAGS = -Wall +CFLAGS += -Wall ifdef DEBUG # build with debugging enabled @@ -48,12 +65,14 @@ else CFLAGS += -O2 endif -CFLAGS += $(LOC_INCL) CFLAGS += -D_USE_SOCKET_IO=1 +CFLAGS += -I. +CFLAGS += $(foreach dir,$(MBGLIB_DIRS),-I$(MBGLIB)/$(dir)) + ifneq ($(OS_IS_QNX),) # for QNX we must link the socket library explicitely - CFLAGS += -lsocket + LDFLAGS += -lsocket # we don't yet support serial I/O under QNX CFLAGS += -D_USE_SERIAL_IO=0 else @@ -61,19 +80,13 @@ else endif -SRCS=../$(TARGET).c \ - $(MBGLIB_COMMON)/mbgextio.c \ - $(MBGLIB_COMMON)/mbgserio.c \ - $(MBGLIB_COMMON)/gpsserio.c \ - $(MBGLIB_COMMON)/gpsutils.c \ - $(MBGLIB_COMMON)/aes128.c - +LD = $(CC) .PHONY: all all: $(TARGET) -$(TARGET): $(SRCS) $(MAKEFILE_LIST) - $(CC) $(CFLAGS) $(SRCS) -o $@ +$(TARGET): $(OBJS) + $(LD) $(LDFLAGS) -o $@ $(OBJS) .PHONY: clean |