aboutsummaryrefslogtreecommitdiff
path: root/src/Makefile.include
blob: 749d9aedfb96455b4b1ca04e656873f10b73545e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35


ifdef APPS
  APPDIRS = $(foreach APP, $(APPS), ../uip/apps/$(APP))
  -include $(foreach APP, $(APPS), ../uip/apps/$(APP)/Makefile.$(APP))
  CFLAGS += $(addprefix -I../uip/apps/,$(APPS))
endif

ifndef CCDEP
  CCDEP = $(CC)
endif
ifndef CCDEPCFLAGS
  CCDEPCFLAGS = $(CFLAGS)
endif
ifndef OBJECTDIR
  OBJECTDIR = obj
endif

ifeq (${wildcard $(OBJECTDIR)},)
  DUMMY := ${shell mkdir $(OBJECTDIR)}
endif


vpath %.c . ../uip/uip ../uip/lib $(APPDIRS)

$(OBJECTDIR)/%.o: %.c
	$(CC) $(CFLAGS) -o $@ -c $<

UIP_SOURCES=uip.c uip_arp.c uiplib.c psock.c timer.c uip-neighbor.c

uip.a: ${addprefix $(OBJECTDIR)/, $(UIP_SOURCES:.c=.o)}
	$(AR) a $@ $^

apps.a: ${addprefix $(OBJECTDIR)/, $(APP_SOURCES:.c=.o)}
	$(AR) a $@ $^