Skip to content

Commit 02e14b8

Browse files
committed
Makefile: Add target to build natively
Signed-off-by: Daniel Schaefer <[email protected]>
1 parent a272229 commit 02e14b8

File tree

2 files changed

+34
-10
lines changed

2 files changed

+34
-10
lines changed

Makefile

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1-
gpu_cfg_generator.o : gpu_cfg_generator.c gpu_cfg_generator.h
1+
.PHONY: native clean
2+
3+
gpu_cfg_generator.exe: gpu_cfg_generator
4+
cp gpu_cfg_gen gpu_cfg_gen.exe
5+
6+
gpu_cfg_generator: gpu_cfg_generator.c gpu_cfg_generator.h
27
../cosmopolitan/bin/cosmocc -o gpu_cfg_gen gpu_cfg_generator.c
8+
9+
native: gpu_cfg_generator.c gpu_cfg_generator.h
10+
$(CC) -o gpu_cfg_gen gpu_cfg_generator.c -Wall
311

412

513
clean :

readme.md

+25-9
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,43 @@
11
# build notes
22

3-
uses
4-
https://github.com/jart/cosmopolitan
3+
Uses [cosmpopolitan](https://github.com/jart/cosmopolitan).
54

6-
extract cosmopolitan one folder up
5+
Extract cosmopolitan release zip one folder up.
76

7+
```sh
88
run make
9+
```
910

11+
To use it on windows, rename `gpu_cfg_gen` to `gpu_cfg_gen.exe`.
1012

11-
to use on windows rename
1213

13-
gpu_cfg_gen to gpu_cfg_gen.exe
1414

15+
# Running
16+
When the application is run, pass in the serial, and for the GPU, the PCB serial.
17+
The application will generate a `.bin` file in the same directory with the EEPROM contents.
1518

16-
17-
# Running
18-
when the application is run, pass in the serial, and for the GPU, the PCB serial.
19-
The application will generate a .bin file in the same directory with the EEPROM contents
2019
## Generate GPU Serial
2120

21+
```
2222
./gpu_cfg_gen -g -s FRAKMBCP81331ASSY0 -p FRAGMASP81331PCB00
23+
```
2324

2425

2526
## Generate SSD
2627

28+
```
2729
./gpu_cfg_gen -d -s FRAKMBCP81331ASSY0
30+
```
31+
32+
# Build natively
33+
34+
While the regular build builds a single executable that runs on Linux and
35+
Windows, for development purpose you might want to build using native tooling.
36+
37+
```sh
38+
# With GCC
39+
make native CC=gcc
40+
41+
# With clang
42+
make native CC=clang
43+
```

0 commit comments

Comments
 (0)