Skip to content

Commit 574a40e

Browse files
committed
Working on support for cygwin and mingw.
1 parent 2ff6587 commit 574a40e

File tree

5 files changed

+90
-101
lines changed

5 files changed

+90
-101
lines changed

.gitignore

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,29 @@
11

2-
# Directories ...
3-
build/
2+
# Copyright (c) 2018 embed-dsp
3+
# All Rights Reserved
4+
5+
# $Author: Gudmundur Bogason <gb@embed-dsp.com> $
6+
# $Date: $
7+
# $Revision: $
8+
9+
# Directories
10+
build*/
11+
dist/
12+
install/
13+
work/
414
tmp/
5-
openocd/
15+
__pycache__/
16+
openocd*/
617
nbproject/
718

819
# Backup files
920
*~
21+
22+
# Python bytecode files
23+
*.pyc
24+
25+
# Object files
26+
*.o
27+
28+
# Java class files
29+
*.class

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2017-2018 embed-dsp
3+
Copyright (c) 2018 embed-dsp
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Makefile

Lines changed: 56 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11

2-
# Copyright (c) 2017-2018 embed-dsp
2+
# Copyright (c) 2018 embed-dsp
33
# All Rights Reserved
44

55
# $Author: Gudmundur Bogason <gb@embed-dsp.com> $
66
# $Date: $
77
# $Revision: $
88

99

10-
CC = /usr/bin/gcc
11-
1210
PACKAGE_NAME = openocd
1311

1412
# Package version number (git master branch / git tag)
@@ -17,20 +15,61 @@ PACKAGE_VERSION = master
1715

1816
PACKAGE = $(PACKAGE_NAME)-$(PACKAGE_VERSION)
1917

20-
# Architecture.
21-
ARCH = $(shell ./bin/get_arch.sh)
22-
23-
# Installation.
24-
PREFIX = /opt/openocd/$(PACKAGE)
25-
EXEC_PREFIX = $(PREFIX)/$(ARCH)
26-
2718
# Set number of simultaneous jobs (Default 4)
2819
ifeq ($(J),)
2920
J = 4
3021
endif
3122

23+
# System and Machine.
24+
SYSTEM = $(shell ./bin/get_system.sh)
25+
MACHINE = $(shell ./bin/get_machine.sh)
26+
27+
# System configuration.
28+
CONFIGURE_FLAGS = --enable-sysfsgpio --enable-bcm2835gpio
29+
30+
# Linux system.
31+
ifeq ($(SYSTEM),linux)
32+
# Compiler.
33+
CC = /usr/bin/gcc
34+
# Installation directory.
35+
INSTALL_DIR = /opt
36+
endif
37+
38+
# Cygwin system.
39+
ifeq ($(SYSTEM),cygwin)
40+
# Compiler.
41+
CC = /usr/bin/gcc
42+
# Installation directory.
43+
INSTALL_DIR = /cygdrive/c/opt
44+
endif
45+
46+
# MSYS2/mingw32 system.
47+
ifeq ($(SYSTEM),mingw32)
48+
# Compiler.
49+
CC = /mingw32/bin/gcc
50+
# Installation directory.
51+
INSTALL_DIR = /c/opt
52+
endif
53+
54+
# MSYS2/mingw64 system.
55+
ifeq ($(SYSTEM),mingw64)
56+
# Compiler.
57+
CC = /mingw64/bin/gcc
58+
# Installation directory.
59+
INSTALL_DIR = /c/opt
60+
endif
61+
62+
# Architecture.
63+
ARCH = $(SYSTEM)_$(MACHINE)
64+
65+
# Installation directories.
66+
PREFIX = $(INSTALL_DIR)/$(PACKAGE_NAME)/$(PACKAGE)
67+
EXEC_PREFIX = $(PREFIX)/$(ARCH)
68+
3269

3370
all:
71+
@echo "ARCH = $(ARCH)"
72+
@echo "PREFIX = $(PREFIX)"
3473
@echo ""
3574
@echo "## Get Source Code"
3675
@echo "make clone"
@@ -42,11 +81,11 @@ all:
4281
@echo "make compile [J=...]"
4382
@echo ""
4483
@echo "## Install"
45-
@echo "sudo make install"
84+
@echo "[sudo] make install"
4685
@echo ""
4786
@echo "## Cleanup"
48-
@echo "make distclean"
4987
@echo "make clean"
88+
@echo "make distclean"
5089
@echo ""
5190

5291

@@ -76,10 +115,14 @@ prepare:
76115
# Rebuild configure
77116
cd $(PACKAGE_NAME) && ./bootstrap
78117

118+
# ...
119+
# cd $(PACKAGE_NAME) && chmod +x configure
120+
# cd $(PACKAGE_NAME) && chmod +x jimtcl/configure
121+
79122

80123
.PHONY: configure
81124
configure:
82-
cd $(PACKAGE_NAME) && ./configure CC=$(CC) --prefix=$(PREFIX) --exec_prefix=$(EXEC_PREFIX) --enable-sysfsgpio --enable-bcm2835gpio
125+
cd $(PACKAGE_NAME) && ./configure CC=$(CC) --prefix=$(PREFIX) --exec_prefix=$(EXEC_PREFIX) $(CONFIGURE_FLAGS)
83126

84127

85128
.PHONY: compile

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,20 +69,20 @@ sudo make install
6969

7070
The build products are installed in the following locations:
7171
```bash
72-
opt
73-
└── openocd
74-
└── openocd-master
75-
├── linux_x86_64 # 64-bit binaries and libraries for Linux
76-
│   ├── bin
72+
opt/
73+
└── openocd/
74+
└── openocd-master/
75+
├── linux_x86_64/ # 64-bit binaries and libraries for Linux
76+
│   ├── bin/
7777
│ │ ├── openocd
7878
│ │ ...
79-
├── linux_x86 # 32-bit binaries and libraries for Linux
80-
│   ├── bin
79+
├── linux_x86/ # 32-bit binaries and libraries for Linux
80+
│   ├── bin/
8181
│ │ ├── openocd
8282
│ │ ...
83-
└── share # Architecture independent data files.
84-
   ├── openocd
85-
│   ├── scripts
83+
└── share/ # Architecture independent data files.
84+
   ├── openocd/
85+
│   ├── scripts/
8686
...
8787
```
8888

bin/get_arch.sh

Lines changed: 0 additions & 74 deletions
This file was deleted.

0 commit comments

Comments
 (0)