-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
45 lines (34 loc) · 1.11 KB
/
Makefile
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
all: lpc21isp
GLOBAL_DEP = adprog.h lpc21isp.h lpcprog.h lpcterm.h
CC = gcc
MACHINE = $(shell uname -m)
ifneq ($(findstring(freebsd, $(OSTYPE))),)
CFLAGS+=-D__FREEBSD__
endif
ifeq ($(OSTYPE),)
OSTYPE = $(shell uname)
endif
ifneq ($(findstring Darwin,$(OSTYPE)),)
CFLAGS+=-D__APPLE__
# Use LLVM on newer Mac OS X
CC = cc
# -static does now longer work (easily) at newer versions of Mac OS X: Use the default (dynamic)
# See e.g. http://stackoverflow.com/questions/844819/how-to-static-link-on-os-x and
# https://developer.apple.com/library/ios/#qa/qa1118/_index.html
else
CFLAGS+=-static
endif
CFLAGS += -Wall
ifeq ($(MACHINE),armv6l)
CFLAGS+=-D__raspi__
endif
adprog.o: adprog.c $(GLOBAL_DEP)
$(CC) $(CDEBUG) $(CFLAGS) -c -o adprog.o adprog.c
lpcprog.o: lpcprog.c $(GLOBAL_DEP)
$(CC) $(CDEBUG) $(CFLAGS) -c -o lpcprog.o lpcprog.c
lpcterm.o: lpcterm.c $(GLOBAL_DEP)
$(CC) $(CDEBUG) $(CFLAGS) -c -o lpcterm.o lpcterm.c
lpc21isp: lpc21isp.c adprog.o lpcprog.o lpcterm.o $(GLOBAL_DEP)
$(CC) $(CDEBUG) $(CFLAGS) -o lpc21isp lpc21isp.c adprog.o lpcprog.o lpcterm.o
clean:
$(RM) adprog.o lpcprog.o lpcterm.o lpc21isp