1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

update Makefile

git-svn-id: https://zerberus.eonerc.rwth-aachen.de:8443/svn/s2ss/trunk@8 8ec27952-4edc-4aab-86aa-e87bb2611832
This commit is contained in:
Steffen Vogel 2014-06-05 09:34:34 +00:00
parent bc308f1cdf
commit bfacfbd34a

View file

@ -5,7 +5,7 @@ OBJS = utils.o msg.o
SRCS = $(wildcard src/*.c)
DEPS = $(SRCS:src/%.c=dep/%.d)
SUBDIRS = doc
DIRS = dep bin build
# Files
bin/server: OBJS += main.o node.o path.o
@ -24,38 +24,32 @@ RM = rm -f
CC = gcc -c
LD = gcc
DEP = gcc -MM
GDB = gdb -q
MKDIR = mkdir -p
RMDIR = rm -rf
# Pseudotargets
.SECONDARY:
.SECONDEXPANSION:
.PHONY: all clean realclean debug depend $(SUBDIRS)
.PHONY: all clean doc
all: $(addprefix bin/,$(TARGETS))
all: $(addprefix bin/,$(TARGETS))
bin/%: $$(addprefix build/,$$(OBJS))
bin/%: $$(addprefix build/,$$(OBJS)) | bin
$(LD) $(LDFLAGS) $^ -o $@
build/%.o: src/%.c dep/%.d
build/%.o: src/%.c dep/%.d | build
$(CC) $(CFLAGS) $< -o $@
dep/%.d: src/%.c
dep/%.d: src/%.c | dep
$(DEP) $(CFLAGS) $< -o $@
debug: bin/server
$(GDB) -ex "break main" -ex "run $(ARGS)" bin/server
clean:
$(RM) build/* bin/*
$(RMDIR) $(DIRS)
realclean: clean
@for DIR in $(SUBDIRS); do $(MAKE) -C $$DIR clean; done
$(DIRS):
$(MKDIR) $@
depend: $(DEPS)
$(SUBDIRS):
doc:
$(MAKE) -C $@
-include $(DEPS)