6c1426a42cc012f045830440dd3ea926c6b1c05c
Stefan Schuermans expand during assignment

Stefan Schuermans authored 7 years ago

1) CONFIG :=
2) DEFINE :=
Stefan Schuermans makefile support for windows

Stefan Schuermans authored 7 years ago

3) INCLUDE := -Icommon
Stefan Schuermans implement SIP

Stefan Schuermans authored 5 years ago

4) CFLAGS := -Wall -Wextra -Werror -std=c++11 -O2 $(EXTRA_CFLAGS)
Stefan Schuermans File + Directory for Windows

Stefan Schuermans authored 7 years ago

5) LDFLAGS := $(EXTRA_LDFLAGS)
6) LIBS := -lBlinkenLib $(EXTRA_LIBS)
Stefan Schuermans adapt Makefile to build for...

Stefan Schuermans authored 7 years ago

7) LAST_LIBS :=
Stefan Schuermans makefile support for windows

Stefan Schuermans authored 7 years ago

8) TARGET := Blinker
9) ifeq ($(CROSS_WIN),1)
10) CXX := x86_64-w64-mingw32-g++
11) PLATFORM := windows
Stefan Schuermans adapt Makefile to build for...

Stefan Schuermans authored 7 years ago

12) LDFLAGS += -static
13) LAST_LIBS += -lws2_32
Stefan Schuermans makefile support for windows

Stefan Schuermans authored 7 years ago

14) TARGET := Blinker.exe
15) else
16) CXX := g++
17) PLATFORM := linux
Stefan Schuermans implement SIP

Stefan Schuermans authored 5 years ago

18) LIBS += -lpthread
Stefan Schuermans makefile support for windows

Stefan Schuermans authored 7 years ago

19) endif
20) INCLUDE += -I$(PLATFORM)
Stefan Schuermans expand during assignment

Stefan Schuermans authored 7 years ago

21) 
Stefan Schuermans improve build system

Stefan Schuermans authored 7 years ago

22) CFGS := $(wildcard config/*.cfg.sh)
Stefan Schuermans expand during assignment

Stefan Schuermans authored 7 years ago

23) CFGS_BASE := $(patsubst %.cfg.sh,%,$(CFGS))
24) CFGS_MK := $(addsuffix .cfg.mk,$(CFGS_BASE))
Stefan Schuermans improve build system

Stefan Schuermans authored 7 years ago

25) 
Stefan Schuermans makefile support for windows

Stefan Schuermans authored 7 years ago

26) SRCS := $(wildcard common/*.cpp) $(wildcard $(PLATFORM)/*.cpp)
Stefan Schuermans expand during assignment

Stefan Schuermans authored 7 years ago

27) SRCS_BASE := $(patsubst %.cpp,%,$(SRCS))
Stefan Schuermans improve build system

Stefan Schuermans authored 7 years ago

28) DEPS := $(addprefix obj/,$(addsuffix .d,$(SRCS_BASE)))
29) OBJS := $(addprefix obj/,$(addsuffix .o,$(SRCS_BASE)))
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

30) 
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

32) .SUFFIXES:
33) .SECONDARY:
34) 
Stefan Schuermans improve auto dependencies

Stefan Schuermans authored 7 years ago

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

Stefan Schuermans authored 13 years ago

36) 
37) ifneq ($(MAKECMDGOALS),clean)
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 13 years ago

38)   ifneq ($(MAKECMDGOALS),distclean)
39)     include config.mk
Stefan Schuermans improve auto dependencies

Stefan Schuermans authored 7 years ago

40)     -include $(DEPS)
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 13 years ago

41)   endif
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

42) endif
43) 
Stefan Schuermans expand during assignment

Stefan Schuermans authored 7 years ago

44) DEFINE += -DBLINKER_CONFIG="\"$(CONFIG)\""
Stefan Schuermans adapt Makefile to build for...

Stefan Schuermans authored 7 years ago

45) LIBS += $(LAST_LIBS)
Stefan Schuermans expand during assignment

Stefan Schuermans authored 7 years ago

46) 
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 13 years ago

47) config.mk: $(CFGS_MK)
48) 	cat /dev/null $^ >$@
49) 
50) %.cfg.mk: %.cfg.sh
51) 	sh $< >$@
52) 
Stefan Schuermans improve build system

Stefan Schuermans authored 7 years ago

53) obj:
Stefan Schuermans makefile support for windows

Stefan Schuermans authored 7 years ago

54) 	mkdir $@ $@/common $@/$(PLATFORM)
Stefan Schuermans improve build system

Stefan Schuermans authored 7 years ago

55) 
56) obj/%.d: %.cpp Makefile config.mk | obj
57) 	$(CXX) $(DEFINE) $(INCLUDE) $(CFLAGS) -MM -MT $(@:.d=.o) -o $@ $<
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

58) 
Stefan Schuermans improve build system

Stefan Schuermans authored 7 years ago

59) obj/%.o: %.cpp Makefile | obj
Stefan Schuermans C++ compiler is CXX

Stefan Schuermans authored 7 years ago

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

Stefan Schuermans authored 13 years ago

61) 
62) $(TARGET): $(OBJS)
Stefan Schuermans C++ compiler is CXX

Stefan Schuermans authored 7 years ago

63) 	$(CXX) $(LDFLAGS) -o $@ $+ $(LIBS)
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

64) 
65) clean:
Stefan Schuermans makefile support for windows

Stefan Schuermans authored 7 years ago

66) 	rm -rf obj $(TARGET)
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

67)