CLEANUP = rm -f MKDIR = mkdir -p TARGET_EXTENSION=out .PHONY: cleandep .PHONY: clean PATHS = src/ PATHL = lib/ PATHB = build/ PATHD = build/depends/ PATHO = build/objs/ BUILD_PATHS = $(PATHB) $(PATHD) $(PATHO) $(PATHL) CROSSCOMPILE = arm-linux-gnueabihf-gcc -c CROSSLINK = arm-linux-gnueabihf-gcc DEPEND = gcc -MM -MG -MF CROSSFLAGS = -I. -I$(PATHS) -I$(PATHL) -D_DEFAULT_SOURCE # CROSSFLAGS = -I. -I$(PATHS) -I$(PATHL) -D_POSIX_C_SOURCE -D_DEFAULT_SOURCE CROSSFLAGS += -std=c99 CROSSFLAGS += -march=armv6 CROSSFLAGS += -mfloat-abi=hard CROSSFLAGS += -mfpu=vfp CROSSFLAGS += -Wall CROSSFLAGS += -Wextra CROSSFLAGS += -Wpointer-arith CROSSFLAGS += -Wcast-align # CROSSFLAGS += -Wwrite-strings CROSSFLAGS += -Wswitch-default CROSSFLAGS += -Wunreachable-code CROSSFLAGS += -Winit-self CROSSFLAGS += -Wmissing-field-initializers CROSSFLAGS += -Wno-unknown-pragmas CROSSFLAGS += -Wstrict-prototypes CROSSFLAGS += -Wundef CROSSFLAGS += -Wold-style-definition RELEASE = $(PATHB)zaqar.$(TARGET_EXTENSION) RELEASEDEPS = $(patsubst $(PATHL)%.c,$(PATHO)%.o, $(wildcard $(PATHL)*.c)) release: $(RELEASEDEPS) $(RELEASE) $(PATHB)zaqar.$(TARGET_EXTENSION):: $(PATHO)zaqar.o $(RELEASEDEPS) $(CROSSLINK) -o $@ $^ $(PATHO)zaqar.o:: $(PATHS)zaqar.c $(CROSSCOMPILE) $(CROSSFLAGS) $< -o $@ $(PATHO)%.o:: $(PATHL)%.c $(CROSSCOMPILE) $(CROSSFLAGS) $< -o $@ $(PATHD)%.d:: $(PATHT)%.c $(DEPEND) $@ $< $(PATHB): $(MKDIR) $(PATHB) $(PATHD): $(MKDIR) $(PATHD) $(PATHO): $(MKDIR) $(PATHO) clean: $(CLEANUP) $(PATHO)*.o $(CLEANUP) $(PATHB)*.$(TARGET_EXTENSION) $(CLEANUP) $(PATHTR)*.c cleandep: $(CLEANUP) $(PATHD)*.d .PRECIOUS: $(PATHD)%.d .PRECIOUS: $(PATHO)%.o