File: Makefile

package info (click to toggle)
lpctools 1.07-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 240 kB
  • sloc: ansic: 2,075; makefile: 41
file content (53 lines) | stat: -rw-r--r-- 1,046 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Makefile for Tools

CC = $(CROSS_COMPILE)gcc

CFLAGS += -Wall -Wextra -O2

all: lpcisp lpcprog lpc_binary_check


OBJDIR = objs
SRC = $(shell find . -name \*.c)
OBJS = ${SRC:%.c=${OBJDIR}/%.o}

LPCISP_OBJS = ${OBJDIR}/lpcisp.o \
		${OBJDIR}/isp_utils.o \
		${OBJDIR}/isp_commands.o \
		${OBJDIR}/isp_wrapper.o
	
LPCPROG_OBJS = ${OBJDIR}/lpcprog.o \
		${OBJDIR}/isp_utils.o \
		${OBJDIR}/isp_commands.o \
		${OBJDIR}/prog_commands.o \
		${OBJDIR}/parts.o

LPCCHECK_OBJS = ${OBJDIR}/check.o \
		${OBJDIR}/isp_utils.o

lpcisp: $(LPCISP_OBJS)
	@echo "Linking $@ ..."
	@$(CC) $(LDFLAGS) $(LPCISP_OBJS) -o $@
	@echo Done.

lpcprog: $(LPCPROG_OBJS)
	@echo "Linking $@ ..."
	@$(CC) $(LDFLAGS) $(LPCPROG_OBJS) -o $@
	@echo Done.

lpc_binary_check: $(LPCCHECK_OBJS)
	@echo "Linking $@ ..."
	@$(CC) $(LDFLAGS) $(LPCCHECK_OBJS) -o $@
	@echo Done.

${OBJDIR}/%.o: %.c
	@mkdir -p $(dir $@)
	@echo "-- compiling" $<
	@$(CC) -MMD -MP -MF ${OBJDIR}/$*.d $(CPPFLAGS) $(CFLAGS) $< -c -o $@


clean:
	rm -f ${OBJDIR}/*
mrproper: clean
	rm -f lpcisp
	rm -f lpcprog