Skip to content

Commit

Permalink
Merge pull request #41 from daniel214/apple-m1
Browse files Browse the repository at this point in the history
Update to build clean on macOS 10.11 with M1 cpu
  • Loading branch information
laamaa authored Mar 9, 2022
2 parents 1a28e51 + f54cf93 commit 4ca038f
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 16 deletions.
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ OBJ = main.o serial.o slip.o command.o write.o render.o ini.o config.o input.o f
DEPS = serial.h slip.h command.h write.h render.h ini.h config.h input.h

#Any special libraries you are using in your project (e.g. -lbcm2835 -lrt `pkg-config --libs gtk+-3.0` ), or leave blank
INCLUDES = -lserialport
INCLUDES = $(shell pkg-config --libs sdl2 libserialport)



#Set any compiler flags you want to use (e.g. -I/usr/include/somefolder `pkg-config --cflags gtk+-3.0` ), or leave blank
CFLAGS = `sdl2-config --libs --cflags` -march=native -Wall -O2 -pipe -I.
CFLAGS = $(shell pkg-config --cflags sdl2 libserialport) -Wall -O2 -pipe -I.

#Set the compiler you are using ( gcc for C or g++ for C++ )
CC = gcc
Expand All @@ -26,7 +28,7 @@ m8c: $(OBJ)
$(CC) -o $@ $^ $(CFLAGS) $(INCLUDES)

font.c: inline_font.h
@echo "#include <SDL2/SDL.h>" > $@-tmp1
@echo "#include <SDL.h>" > $@-tmp1
@cat inline_font.h >> $@-tmp1
@cat inprint2.c > $@-tmp2
@sed '/#include/d' $@-tmp2 >> $@-tmp1
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ sudo apt update && sudo apt install -y git gcc make libsdl2-dev libserialport-de
This assumes you have [installed brew](https://docs.brew.sh/Installation)

```
brew update && brew install -y git gcc make sdl2 libserialport
brew update && brew install -y git gcc make sdl2 libserialport pkg-config
```
### Download source code (All)

Expand Down
2 changes: 1 addition & 1 deletion SDL2_inprint.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#ifndef SDL2_inprint_h
#define SDL2_inprint_h

#include <SDL2/SDL.h>
#include <SDL.h>

extern void prepare_inline_font(void);
extern void kill_inline_font(void);
Expand Down
2 changes: 1 addition & 1 deletion command.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2021 Jonne Kokkonen
// Released under the MIT licence, https://opensource.org/licenses/MIT

#include <SDL2/SDL_log.h>
#include <SDL_log.h>

#include "command.h"
#include "render.h"
Expand Down
4 changes: 2 additions & 2 deletions config.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Released under the MIT licence, https://opensource.org/licenses/MIT

#include "config.h"
#include <SDL2/SDL.h>
#include <SDL.h>

config_params_s init_config() {
config_params_s c;
Expand Down Expand Up @@ -259,4 +259,4 @@ void read_gamepad_config(ini_t *ini, config_params_s *conf) {
if (gamepad_analog_axis_start) conf->gamepad_analog_axis_start = SDL_atoi(gamepad_analog_axis_start);
if (gamepad_analog_axis_opt) conf->gamepad_analog_axis_opt = SDL_atoi(gamepad_analog_axis_opt);
if (gamepad_analog_axis_edit) conf->gamepad_analog_axis_edit = SDL_atoi(gamepad_analog_axis_edit);
}
}
4 changes: 2 additions & 2 deletions input.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2021 Jonne Kokkonen
// Released under the MIT licence, https://opensource.org/licenses/MIT

#include <SDL2/SDL.h>
#include <SDL.h>
#include <stdio.h>

#include "config.h"
Expand Down Expand Up @@ -419,4 +419,4 @@ input_msg_s get_input_msg(config_params_s *conf) {
// Special event keys already have the correct keycode baked in
return key;
}
}
}
2 changes: 1 addition & 1 deletion main.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2021 Jonne Kokkonen
// Released under the MIT licence, https://opensource.org/licenses/MIT

#include <SDL2/SDL.h>
#include <SDL.h>
#include <libserialport.h>
#include <signal.h>
#include <string.h>
Expand Down
4 changes: 2 additions & 2 deletions render.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include "render.h"

#include <SDL2/SDL.h>
#include <SDL.h>
#include <stdio.h>

#include "SDL2_inprint.h"
Expand Down Expand Up @@ -196,4 +196,4 @@ void render_screen() {
fps = 0;
}
}
}
}
2 changes: 1 addition & 1 deletion serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Contains portions of code from libserialport's examples released to the
// public domain

#include <SDL2/SDL_log.h>
#include <SDL_log.h>
#include <libserialport.h>
#include <stdio.h>
#include <stdlib.h>
Expand Down
4 changes: 2 additions & 2 deletions write.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2021 Jonne Kokkonen
// Released under the MIT licence, https://opensource.org/licenses/MIT

#include <SDL2/SDL_log.h>
#include <SDL_log.h>
#include <libserialport.h>
#include <stdint.h>
#include <stdio.h>
Expand Down Expand Up @@ -83,4 +83,4 @@ int send_msg_keyjazz(struct sp_port *port, uint8_t note, uint8_t velocity) {
}

return 1;
}
}

0 comments on commit 4ca038f

Please sign in to comment.