From 4a4b39fc6f2ef0b61eac1e7c7fd716ce96b09a0f Mon Sep 17 00:00:00 2001 From: Christian Kroll Date: Mon, 14 Mar 2011 10:33:49 +0000 Subject: [PATCH] libm added to the statically linked libraries --- Makefile | 2 +- defaults.mk | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 81b02a9..d9c422a 100644 --- a/Makefile +++ b/Makefile @@ -79,7 +79,7 @@ OBJECTS += $(patsubst %.c,./obj_avr/%.o,${SRC}) SUBDIROBJECTS = $(foreach subdir,$(SUBDIRS_AVR),$(foreach object,$(shell cat $(subdir)/obj_avr/.objects 2>/dev/null),$(subdir)/$(object))) $(TARGET): $(OBJECTS) $(SUBDIROBJECTS) - $(CC) $(LDFLAGS) -o $@ $(OBJECTS) $(SUBDIROBJECTS) + $(CC) $(LDFLAGS) -o $@ $(OBJECTS) $(SUBDIROBJECTS) $(LIBS) ############################################################################## diff --git a/defaults.mk b/defaults.mk index b276d68..7b47988 100644 --- a/defaults.mk +++ b/defaults.mk @@ -17,12 +17,14 @@ STRIP = avr-strip HOSTCC := gcc export HOSTCC +LIBS = -lm + # flags for the compiler CFLAGS ?= -Wall -W -Wno-unused-parameter -Wno-sign-compare -CFLAGS += -g -Os -std=gnu99 -fgnu89-inline -DNDEBUG +CFLAGS += -g -Os -std=gnu99 -fgnu89-inline -D_XOPEN_SOURCE=600 -DNDEBUG # flags for the linker -LDFLAGS += -T ./avr5.x -Wl,-Map,image.map -mmcu=$(MCU) +LDFLAGS += -T ./avr5.x -Wl,-Map,image.map -mmcu=$(MCU) ############################################################################# @@ -33,17 +35,17 @@ MACHINE = $(shell uname -m) #$(info $(OSTYPE)) ifeq ($(OSTYPE),cygwin) - CFLAGS_SIM = -g -Wall -pedantic -std=c99 -O0 -D_WIN32 -mno-cygwin + CFLAGS_SIM = -g -Wall -pedantic -std=c99 -O0 -D_WIN32 -mno-cygwin -D_XOPEN_SOURCE=600 LDFLAGS_SIM = -Wl -mno-cygwin -T simulator/i386pe.x - LIBS_SIM = -lglut32 -lglu32 -lopengl32 + LIBS_SIM = -lglut32 -lglu32 -lopengl32 -lm else - CFLAGS_SIM = -g -Wall -pedantic -std=c99 -O0 + CFLAGS_SIM = -g -Wall -pedantic -std=c99 -O0 -D_XOPEN_SOURCE=600 ifeq ($(MACHINE),x86_64) LDFLAGS_SIM = -Wl -T simulator/elf_x86_64.x else LDFLAGS_SIM = -Wl -T simulator/elf_i386.x endif - LIBS_SIM = -lglut -lpthread -lGL -lGLU + LIBS_SIM = -lglut -lpthread -lGL -lGLU -lm endif ##############################################################################