nes-proj/platform/minimal-net/Makefile.minimal-net

58 lines
1.5 KiB
Makefile
Raw Normal View History

ifndef CONTIKI
$(error CONTIKI not defined! You must specify where CONTIKI resides!)
endif
#contiki: contiki-$(TARGET).a
CONTIKI_TARGET_DIRS = . net
CONTIKI_TARGET_MAIN = ${addprefix $(OBJECTDIR)/,contiki-main.o}
CONTIKI_TARGET_SOURCEFILES = tapdev-service.c tapdev.c contiki-main.c dlloader.c clock.c leds.c leds-arch.c
CONTIKI_SOURCEFILES += $(CONTIKI_TARGET_SOURCEFILES)
.SUFFIXES:
### Define the CPU directory
CONTIKI_CPU=$(CONTIKI)/cpu/x86
### Compiler definitions
CC = gcc
LD = ld
AS = as
OBJCOPY = objcopy
STRIP = strip
CFLAGSNO = -I. -I$(CONTIKI)/core -I$(CONTIKI_CPU) \
-I$(CONTIKI)/platform/$(TARGET) \
${addprefix -I,$(APPDIRS)} $(APP_INCLUDES) \
-DWITH_UIP -DWITH_ASCII \
-Wall -g -I. -I/usr/local/include
CFLAGS += $(CFLAGSNO)
LDFLAGS = -Wl,-Map=contiki.map,-export-dynamic
### Setup directory search path for source files
CONTIKI_TARGET_DIRS_CONCAT = ${addprefix $(CONTIKI)/platform/$(TARGET)/, \
$(CONTIKI_TARGET_DIRS)}
vpath %.c $(PROJECTDIRS) \
$(CONTIKIDIRS) $(APPDIRS) $(CONTIKI_TARGET_DIRS_CONCAT) \
$(CONTIKI_CPU) $(APP_DIRS)
### Compilation rules
# $(OBJECTDIR)/%.o: %.c
# $(CC) $(CFLAGS) -c $< -o $@
%.so: $(OBJECTDIR)/%.o
$(LD) -shared -o $@ $^
# %.ce: %.co
# $(LD) -shared -o $@ $^
# %.co: %.c
# $(CC) $(CFLAGS) -DPROCESS_LOADABLE -c $< -o $@
# $(STRIP) --strip-unneeded -g -x $@
# %: %.co $(CONTIKI_TARGET_MAIN) $(PROJECT_OBJECTFILES) contiki-$(TARGET).a
# $(CC) $(CFLAGS) -o $@.$(TARGET) $^ $(LDFLAGS)