BlinkenArea - GitList
Repositories
Blog
Wiki
Blinker
Code
Commits
Branches
Tags
Search
Tree:
b455a75
Branches
Tags
master
Blinker
src
Makefile
added flexipix output support added auto-configuration stuff to makefile
Stefan Schuermans
commited
b455a75
at 2011-12-14 22:02:48
Makefile
Blame
History
Raw
CFGS=$(wildcard config/*.cfg.sh) SRCS=$(wildcard noarch/*.cpp) $(wildcard linux/*.cpp) TARGET=Blinker CPP=g++ CONFIG= DEFINE=-DBLINKER_CONFIG="\"$(CONFIG)\"" INCLUDE=-Inoarch -Ilinux CFLAGS=-Wall -Wextra -g2 LDFLAGS= LIBS=-lBlinkenLib CFGS_BASE=$(patsubst %.cfg.sh,%,$(CFGS)) CFGS_MK=$(addsuffix .cfg.mk,$(CFGS_BASE)) SRCS_BASE=$(patsubst %.cpp,%,$(SRCS)) DEPS=$(addsuffix .d,$(SRCS_BASE)) OBJS=$(addsuffix .o,$(SRCS_BASE)) .PHONY: all clean distclean .SUFFIXES: .SECONDARY: all: $(TARGET) ifneq ($(MAKECMDGOALS),clean) ifneq ($(MAKECMDGOALS),distclean) include config.mk include deps endif endif config.mk: $(CFGS_MK) cat /dev/null $^ >$@ %.cfg.mk: %.cfg.sh sh $< >$@ deps: $(DEPS) cat /dev/null $^ >$@ %.d: %.cpp Makefile config.mk $(CPP) $(DEFINE) $(INCLUDE) $(CFLAGS) -M -o $@ $< sed -i 1s!^!$(dir $<)! $@ %.o: %.cpp Makefile $(CPP) $(DEFINE) $(INCLUDE) $(CFLAGS) -c -o $@ $< $(TARGET): $(OBJS) $(CPP) $(LDFLAGS) -o $@ $+ $(LIBS) clean: rm -f deps $(DEPS) $(OBJS) $(TARGET) distclean: clean rm -f config.mk $(CFGS_MK)