forked from Galland/rkflashtool_rk3066
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GNUmakefile
85 lines (73 loc) · 2.55 KB
/
GNUmakefile
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Simple Makefile for RK Flash Tool
CC = $(CROSSPREFIX)gcc
LD = $(CC)
CFLAGS = -O2 -W -Wall
LDFLAGS = -s
LIBS = -lusb-1.0
ifdef LIBUSB
CFLAGS += -I$(LIBUSB)/include
LDFLAGS += -L$(LIBUSB)/lib
endif
MACH = $(shell $(CC) -dumpmachine)
ifeq ($(findstring mingw,$(MACH)),mingw)
LDFLAGS += -static
USE_RES = 1
endif
ifeq ($(findstring cygwin,$(MACH)),cygwin)
USE_RES = 1
endif
ifeq ($(USE_RES),1)
RC = $(CROSSPREFIX)windres
RCFLAGS = -O coff -i
BINEXT = .exe
RESFILE = %.res
AWK = awk
VERMAJ = $(shell $(AWK) '/RKFLASHTOOL_VER_MAJOR/{print $$3}' rkflashtool.c)
VERMIN = $(shell $(AWK) '/RKFLASHTOOL_VER_MINOR/{print $$3}' rkflashtool.c)
VERREV = 0
LCOPYR = 2011-2012 Ivo van Poorten
FDESCR = Flashtool for RK2808, RK2818 and RK2918 based tablets
WWWURL = http://sourceforge.net/projects/rkflashtool/
ifeq ($(findstring /sh,$(SHELL)),/sh)
DL = '
endif
endif
PROGS = $(patsubst %.c,%$(BINEXT), $(wildcard *.c))
all: $(PROGS)
%$(BINEXT): %.c $(RESFILE)
$(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) $(LIBS)
clean:
$(RM) $(PROGS) *.res *.rc
%.res: %.rc
$(RC) $(RCFLAGS) $< -o $@
%.rc: GNUmakefile
@echo $(DL)1 VERSIONINFO $(DL)>$@
@echo $(DL) FILEVERSION $(VERMAJ),$(VERMIN),$(VERREV),0 $(DL)>>$@
@echo $(DL) PRODUCTVERSION $(VERMAJ),$(VERMIN),$(VERREV),0 $(DL)>>$@
@echo $(DL) FILEFLAGSMASK 0x3fL $(DL)>>$@
@echo $(DL) FILEOS 0x40004L $(DL)>>$@
@echo $(DL) FILEFLAGS 0x0L $(DL)>>$@
@echo $(DL) FILETYPE 0x1L $(DL)>>$@
@echo $(DL) FILESUBTYPE 0x0L $(DL)>>$@
@echo $(DL)BEGIN $(DL)>>$@
@echo $(DL) BLOCK "StringFileInfo" $(DL)>>$@
@echo $(DL) BEGIN $(DL)>>$@
@echo $(DL) BLOCK "040904E4" $(DL)>>$@
@echo $(DL) BEGIN $(DL)>>$@
@echo $(DL) VALUE "LegalCopyright","\251 $(LCOPYR)\0" $(DL)>>$@
# @echo $(DL) VALUE "CompanyName","$(COMPANY)\0" $(DL)>>$@
@echo $(DL) VALUE "ProductName","$(notdir $(@:.rc=)).exe\0" $(DL)>>$@
@echo $(DL) VALUE "ProductVersion","$(VERMAJ).$(VERMIN).$(VERREV)\0" $(DL)>>$@
@echo $(DL) VALUE "License","Released under BSD license.\0" $(DL)>>$@
@echo $(DL) VALUE "FileDescription","$(FDESCR)\0" $(DL)>>$@
@echo $(DL) VALUE "FileVersion","$(VERMAJ).$(VERMIN).$(VERREV)\0" $(DL)>>$@
@echo $(DL) VALUE "InternalName","$(notdir $(@:.rc=))\0" $(DL)>>$@
@echo $(DL) VALUE "OriginalFilename","$(notdir $(@:.rc=)).exe\0" $(DL)>>$@
@echo $(DL) VALUE "WWW","$(WWWURL)\0" $(DL)>>$@
@echo $(DL) END $(DL)>>$@
@echo $(DL) END $(DL)>>$@
@echo $(DL) BLOCK "VarFileInfo" $(DL)>>$@
@echo $(DL) BEGIN $(DL)>>$@
@echo $(DL) VALUE "Translation", 0x409, 1252 $(DL)>>$@
@echo $(DL) END $(DL)>>$@
@echo $(DL)END $(DL)>>$@