b455a75ced76b6da945cd5d192250885f3f554a9
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

1) CFGS=$(wildcard config/*.cfg.sh)
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

2) SRCS=$(wildcard noarch/*.cpp) $(wildcard linux/*.cpp)
3) TARGET=Blinker
4) 
5) CPP=g++
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

6) CONFIG=
7) DEFINE=-DBLINKER_CONFIG="\"$(CONFIG)\""
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

8) INCLUDE=-Inoarch -Ilinux
9) CFLAGS=-Wall -Wextra -g2
10) LDFLAGS=
11) LIBS=-lBlinkenLib
12) 
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

13) CFGS_BASE=$(patsubst %.cfg.sh,%,$(CFGS))
14) CFGS_MK=$(addsuffix .cfg.mk,$(CFGS_BASE))
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

15) SRCS_BASE=$(patsubst %.cpp,%,$(SRCS))
16) DEPS=$(addsuffix .d,$(SRCS_BASE))
17) OBJS=$(addsuffix .o,$(SRCS_BASE))
18) 
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

19) .PHONY: all clean distclean
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

20) .SUFFIXES:
21) .SECONDARY:
22) 
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

23) all: $(TARGET)
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

24) 
25) ifneq ($(MAKECMDGOALS),clean)
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

26)   ifneq ($(MAKECMDGOALS),distclean)
27)     include config.mk
28)     include deps
29)   endif
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

30) endif
31) 
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

32) config.mk: $(CFGS_MK)
33) 	cat /dev/null $^ >$@
34) 
35) %.cfg.mk: %.cfg.sh
36) 	sh $< >$@
37) 
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

38) deps: $(DEPS)
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

39) 	cat /dev/null $^ >$@
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

40) 
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

41) %.d: %.cpp Makefile config.mk
42) 	$(CPP) $(DEFINE) $(INCLUDE) $(CFLAGS) -M -o $@ $<
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

43) 	sed -i 1s!^!$(dir $<)! $@
44) 
45) %.o: %.cpp Makefile
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

46) 	$(CPP) $(DEFINE) $(INCLUDE) $(CFLAGS) -c -o $@ $<
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

47) 
48) $(TARGET): $(OBJS)
49) 	$(CPP) $(LDFLAGS) -o $@ $+ $(LIBS)
50) 
51) clean:
52) 	rm -f deps $(DEPS) $(OBJS) $(TARGET)
53)