imagerec/makefile

30 lines
649 B
Makefile
Raw Permalink Normal View History

2020-02-05 15:41:16 +00:00
#Ensure that openwrt cross-compile environment variables are set prior to calling make:
2020-04-29 11:49:32 +00:00
# openwrt.config
2020-02-05 15:41:16 +00:00
CC=mipsel-openwrt-linux-gcc
CFLAGS= -std=gnu99
SOURCES= main.c cmdTcpipClient.c imageRec.c
TARGET ?= imagerec
SRC_DIRS ?= ./src
SRCS := $(shell find $(SRC_DIRS) -name *.cpp -or -name *.c -or -name *.s)
OBJS := $(addsuffix .o,$(basename $(SRCS)))
DEPS := $(OBJS:.o=.d)
INC_DIRS := $(shell find $(SRC_DIRS) -type d)
INC_FLAGS := $(addprefix -I,$(INC_DIRS))
CPPFLAGS ?= $(INC_FLAGS) -MMD -MP
$(TARGET): $(OBJS)
$(CC) $(LDFLAGS) $(OBJS) -o $@ $(LOADLIBES) $(LDLIBS)
.PHONY: clean
clean:
$(RM) $(TARGET) $(OBJS) $(DEPS)
-include $(DEPS)