Browse Source

libm added to the statically linked libraries

feature/2015
Christian Kroll 14 years ago
parent
commit
4a4b39fc6f
  1. 2
      Makefile
  2. 12
      defaults.mk

2
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))) 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)
############################################################################## ##############################################################################

12
defaults.mk

@ -17,9 +17,11 @@ 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
############################################################################## ##############################################################################

Loading…
Cancel
Save