Example program for the BSDInterface

Dependencies:   BSDInterface NetworkSocketAPI

Fork of HelloLWIPInterface by NetworkSocketAPI

Revision:
49:e1689f3f04f3
Parent:
48:8a34f47ed1e2
Child:
50:6566cd992ac6
--- a/Makefile	Sat Feb 27 20:12:12 2016 -0600
+++ b/Makefile	Sat Feb 27 21:03:02 2016 -0600
@@ -14,7 +14,7 @@
 AS      = $(GCC_BIN)as
 CC      = $(GCC_BIN)gcc
 CPP     = $(GCC_BIN)g++
-LD      = $(GCC_BIN)gcc
+LD      = $(GCC_BIN)g++
 OBJCOPY = $(GCC_BIN)objcopy
 OBJDUMP = $(GCC_BIN)objdump
 SIZE    = $(GCC_BIN)size 
@@ -27,10 +27,6 @@
 
 
 CC_FLAGS = -c -g -fno-common -fmessage-length=0 -Wall -Wextra -fno-exceptions -ffunction-sections -fdata-sections -fomit-frame-pointer -MMD -MP
-CC_SYMBOLS = -DTARGET_RTOS_M4_M7 -DTARGET_FF_ARDUINO -DTOOLCHAIN_GCC_ARM -DTOOLCHAIN_GCC -DTARGET_KPSDK_MCUS -DTARGET_KPSDK_CODE -DTARGET_FRDM -DTARGET_CORTEX_M -DCPU_MK64FN1M0VMD12 -D__FPU_PRESENT=1 -DTARGET_Freescale -DTARGET_M4 -D__MBED__=1 -DTARGET_K64F -DTARGET_LIKE_CORTEX_M4 -DMBED_BUILD_TIMESTAMP=1456625414.52 -D__CORTEX_M4 -DFSL_RTOS_MBED -DTARGET_MCU_K64F -DARM_MATH_CM4 -DTARGET_LIKE_MBED 
-
-LD_FLAGS = $(CPU) -Wl,--gc-sections --specs=nano.specs -u _printf_float -u _scanf_float -Wl,--wrap,main -Wl,-Map=$(PROJECT).map,--cref
-LD_SYS_LIBS = -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys
 
 
 ifeq ($(DEBUG), 1)
@@ -41,11 +37,11 @@
 
 .PHONY: all clean lst size
 
-all: $(PROJECT).bin $(PROJECT).hex size
+all: $(PROJECT) size
 
 
 clean:
-	rm -f $(PROJECT).bin $(PROJECT).elf $(PROJECT).hex $(PROJECT).map $(PROJECT).lst $(OBJECTS) $(DEPS)
+	rm -f $(PROJECT) $(PROJECT).bin $(PROJECT).elf $(PROJECT).hex $(PROJECT).map $(PROJECT).lst $(OBJECTS) $(DEPS)
 
 
 .asm.o:
@@ -63,10 +59,13 @@
 
 
 
-$(PROJECT).elf: $(OBJECTS) $(SYS_OBJECTS)
-	$(LD) $(LD_FLAGS) -T$(LINKER_SCRIPT) $(LIBRARY_PATHS) -o $@ $^ $(LIBRARIES) $(LD_SYS_LIBS) $(LIBRARIES) $(LD_SYS_LIBS)
+$(PROJECT): $(OBJECTS) $(SYS_OBJECTS)
+	$(LD) $(LD_FLAGS) $(LIBRARY_PATHS) -o $@ $^ $(LIBRARIES) $(LD_SYS_LIBS) $(LIBRARIES) $(LD_SYS_LIBS)
 
 
+$(PROJECT).elf: $(PROJECT)
+	cp $< $@
+
 $(PROJECT).bin: $(PROJECT).elf
 	$(OBJCOPY) -O binary $< $@
 
@@ -78,8 +77,8 @@
 
 lst: $(PROJECT).lst
 
-size: $(PROJECT).elf
-	$(SIZE) $(PROJECT).elf
+size: $(PROJECT)
+	$(SIZE) $(PROJECT)
 
 DEPS = $(OBJECTS:.o=.d) $(SYS_OBJECTS:.o=.d)
 -include $(DEPS)