-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathMakefile
48 lines (36 loc) · 1.06 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
46
47
48
CC ?= gcc
RM ?= rm -rf
STRIP ?= strip
CFLAGS += -std=c99 -pedantic -Wall -O2
all: easypdkprog
UNAME_S := $(shell uname -s)
ifeq ($(OSTYPE),msys)
UNAME_S := Windows
endif
ifeq ($(OS),Windows_NT)
EXE_EXTENSION := .exe
endif
ifneq ($(UNAME_S),Linux)
ARGPSA = lib/argp-standalone-1.3
ARGPSALIB = $(ARGPSA)/libargp.a
CFLAGS += -I$(ARGPSA)
endif
DEP= $(wildcard *.h)
SRC= serialcom.c fpdkutil.c fpdkcom.c fpdkicdata.c fpdkihex8.c fpdkiccalib.c fpdkicserial.c
OBJ= $(subst .c,.o,$(SRC))
easypdkprog: $(ARGPSALIB) $(DEP) $(OBJ) easypdkprog.c
$(CC) $(CFLAGS) $(LDFLAGS) -o easypdkprog easypdkprog.c $(OBJ) $(LIBS) $(ARGPSALIB)
$(STRIP) easypdkprog$(EXE_EXTENSION)
easypdkprogtest: $(DEP) $(OBJ) easypdkprogtest.c
$(CC) $(CFLAGS) $(LDFLAGS) -o easypdkprogtest easypdkprogtest.c $(OBJ) $(LIBS)
$(ARGPSALIB):
cd $(ARGPSA) && sh configure CFLAGS='-w -Os'
$(MAKE) -C $(ARGPSA)
clean:
$(RM) $(OBJ)
$(RM) easypdkprog$(EXE_EXTENSION)
$(RM) easypdkprogtest$(EXE_EXTENSION)
distclean: clean
ifneq ($(UNAME_S),Linux)
-$(MAKE) distclean -C $(ARGPSA)
endif