Initial import
[actions-micro-tools.git] / Makefile
1 CFLAGS ?= -std=c99 -pedantic -Wall -Wextra -O2
2
3 CFLAGS += -pedantic-errors
4
5 # GCC >= 4.6
6 CFLAGS += -Wunused-but-set-variable
7
8 CFLAGS += -fno-common \
9   -Wall \
10   -Wextra \
11   -Wformat=2 \
12   -Winit-self \
13   -Winline \
14   -Wpacked \
15   -Wp,-D_FORTIFY_SOURCE=2 \
16   -Wpointer-arith \
17   -Wlarger-than-65500 \
18   -Wmissing-declarations \
19   -Wmissing-format-attribute \
20   -Wmissing-noreturn \
21   -Wmissing-prototypes \
22   -Wnested-externs \
23   -Wold-style-definition \
24   -Wredundant-decls \
25   -Wsign-compare \
26   -Wstrict-aliasing=2 \
27   -Wstrict-prototypes \
28   -Wswitch-enum \
29   -Wundef \
30   -Wunreachable-code \
31   -Wunsafe-loop-optimizations \
32   -Wwrite-strings
33
34 # for some functions in endian.h
35 CFLAGS += -D_BSD_SOURCE
36
37 # for getopt()
38 CFLAGS += -D_POSIX_C_SOURCE=2
39
40 PREFIX ?= /usr/local
41 bindir := $(PREFIX)/sbin
42
43 actions-firmware-extract: actions-firmware-extract.o
44
45 test: actions-firmware-extract
46         rm -rf PPX2230 && \
47         ./actions-firmware-extract -d PPX2230 ppx2230_eu_fus_aen.bin
48
49 install: actions-firmware-extract
50         install -d $(DESTDIR)$(bindir)
51         install -m 755 actions-firmware-extract $(DESTDIR)$(bindir)
52
53 clean:
54         rm -rf *~ *.o actions-firmware-extract endian endian.h