libm added to the statically linked libraries

This commit is contained in:
Christian Kroll 2011-03-14 10:33:49 +00:00
parent 01347c853b
commit 4a4b39fc6f
2 changed files with 9 additions and 7 deletions

View File

@ -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))) SUBDIROBJECTS = $(foreach subdir,$(SUBDIRS_AVR),$(foreach object,$(shell cat $(subdir)/obj_avr/.objects 2>/dev/null),$(subdir)/$(object)))
$(TARGET): $(OBJECTS) $(SUBDIROBJECTS) $(TARGET): $(OBJECTS) $(SUBDIROBJECTS)
$(CC) $(LDFLAGS) -o $@ $(OBJECTS) $(SUBDIROBJECTS) $(CC) $(LDFLAGS) -o $@ $(OBJECTS) $(SUBDIROBJECTS) $(LIBS)
############################################################################## ##############################################################################

View File

@ -17,12 +17,14 @@ STRIP = avr-strip
HOSTCC := gcc HOSTCC := gcc
export HOSTCC export HOSTCC
LIBS = -lm
# flags for the compiler # flags for the compiler
CFLAGS ?= -Wall -W -Wno-unused-parameter -Wno-sign-compare 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 # 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)) #$(info $(OSTYPE))
ifeq ($(OSTYPE),cygwin) 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 LDFLAGS_SIM = -Wl -mno-cygwin -T simulator/i386pe.x
LIBS_SIM = -lglut32 -lglu32 -lopengl32 LIBS_SIM = -lglut32 -lglu32 -lopengl32 -lm
else 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) ifeq ($(MACHINE),x86_64)
LDFLAGS_SIM = -Wl -T simulator/elf_x86_64.x LDFLAGS_SIM = -Wl -T simulator/elf_x86_64.x
else else
LDFLAGS_SIM = -Wl -T simulator/elf_i386.x LDFLAGS_SIM = -Wl -T simulator/elf_i386.x
endif endif
LIBS_SIM = -lglut -lpthread -lGL -lGLU LIBS_SIM = -lglut -lpthread -lGL -lGLU -lm
endif endif
############################################################################## ##############################################################################