diff options
author | B. Watson <yalhcru@gmail.com> | 2019-03-13 02:50:42 -0400 |
---|---|---|
committer | B. Watson <yalhcru@gmail.com> | 2019-03-13 02:50:42 -0400 |
commit | 2973d0c78e9b8eed3c5af239927c6bd36af64604 (patch) | |
tree | a0fdfe7201303edd11c6d86015ef4f79796fcf0f /src/Makefile.include | |
download | fujichat-2973d0c78e9b8eed3c5af239927c6bd36af64604.tar.gz |
initial commit
Diffstat (limited to 'src/Makefile.include')
-rw-r--r-- | src/Makefile.include | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/Makefile.include b/src/Makefile.include new file mode 100644 index 0000000..05ce291 --- /dev/null +++ b/src/Makefile.include @@ -0,0 +1,47 @@ + + +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 $< + +$(OBJECTDIR)/%.d: %.c + @set -e; rm -f $@; \ + $(CCDEP) -MM $(CCDEPCFLAGS) $< > $@.$$$$; \ + sed 's,\($*\)\.o[ :]*,$(OBJECTDIR)/\1.o $@ : ,g' < $@.$$$$ > $@; \ + rm -f $@.$$$$ + +UIP_SOURCES=uip.c uip_arp.c uiplib.c psock.c timer.c uip-neighbor.c + + +ifneq ($(MAKECMDGOALS),clean) +-include $(addprefix $(OBJECTDIR)/,$(UIP_SOURCES:.c=.d) \ + $(APP_SOURCES:.c=.d)) +endif + +uip.a: ${addprefix $(OBJECTDIR)/, $(UIP_SOURCES:.c=.o)} + $(AR) a $@ $^ + +apps.a: ${addprefix $(OBJECTDIR)/, $(APP_SOURCES:.c=.o)} + $(AR) a $@ $^ |