Skip to content

Commit

Permalink
general: Decouple platform.h
Browse files Browse the repository at this point in the history
* All units which #include "general.h" get rebuilt after editing platform.h,
  which increases incremental build times during development.
  Especially target code, which is huge and platform-agnostic.
* Move platform.h out into relevant units.
  • Loading branch information
ALTracer authored and dragonmux committed Jul 12, 2023
1 parent 95c66e7 commit 314eec8
Show file tree
Hide file tree
Showing 19 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*/

#include "general.h"
#include "platform.h"
#include "exception.h"
#include "command.h"
#include "gdb_packet.h"
Expand Down
1 change: 1 addition & 0 deletions src/gdb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*/

#include "general.h"
#include "platform.h"
#include "ctype.h"
#include "hex_utils.h"
#include "gdb_if.h"
Expand Down
2 changes: 1 addition & 1 deletion src/include/general.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include <sys/types.h>

#include "maths_utils.h"
#include "platform.h"
#include "timing.h"
#include "platform_support.h"

#ifndef ARRAY_LENGTH
Expand Down
1 change: 1 addition & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
/* Provides main entry point. Initialise subsystems and enter GDB protocol loop. */

#include "general.h"
#include "platform.h"
#include "gdb_if.h"
#include "gdb_main.h"
#include "target.h"
Expand Down
1 change: 1 addition & 0 deletions src/platforms/common/aux_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <libopencm3/cm3/nvic.h>

#include "general.h"
#include "platform.h"
#include "usb_serial.h"
#include "aux_serial.h"

Expand Down
1 change: 1 addition & 0 deletions src/platforms/common/jtagtap.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <stdio.h>

#include "general.h"
#include "platform.h"
#include "jtagtap.h"

jtag_proc_s jtag_proc;
Expand Down
1 change: 1 addition & 0 deletions src/platforms/common/stm32/dfucore.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

#include "general.h"
#include "platform.h"
#include "version.h"
#include "serialno.h"
#include <string.h>
Expand Down
1 change: 1 addition & 0 deletions src/platforms/common/stm32/gdb_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <libopencmsis/core_cm3.h>

#include "general.h"
#include "platform.h"
#include "usb_serial.h"
#include "gdb_if.h"

Expand Down
1 change: 1 addition & 0 deletions src/platforms/common/stm32/serialno.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "general.h"
#include "platform.h"
#include <libopencm3/stm32/desig.h>

char serial_no[DFU_SERIAL_LENGTH];
Expand Down
1 change: 1 addition & 0 deletions src/platforms/common/stm32/timing_stm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "general.h"
#include "platform.h"
#include "morse.h"

#include <libopencm3/cm3/systick.h>
Expand Down
1 change: 1 addition & 0 deletions src/platforms/common/stm32/traceswo.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
* The core can then process the buffer to extract the frame.
*/
#include "general.h"
#include "platform.h"
#include "usb.h"
#include "traceswo.h"

Expand Down
1 change: 1 addition & 0 deletions src/platforms/common/stm32/traceswoasync.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

#include <stdatomic.h>
#include "general.h"
#include "platform.h"
#include "usb.h"
#include "traceswo.h"

Expand Down
1 change: 1 addition & 0 deletions src/platforms/common/stm32/traceswoasync_f723.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

#include <stdatomic.h>
#include "general.h"
#include "platform.h"
#include "usb.h"
#include "traceswo.h"

Expand Down
1 change: 1 addition & 0 deletions src/platforms/common/swdptap.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
/* This file implements the SW-DP interface. */

#include "general.h"
#include "platform.h"
#include "timing.h"
#include "swd.h"

Expand Down
1 change: 1 addition & 0 deletions src/platforms/common/tm4c/traceswo.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
*/

#include "general.h"
#include "platform.h"
#include "usb.h"

#include <libopencm3/cm3/nvic.h>
Expand Down
1 change: 1 addition & 0 deletions src/platforms/common/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <libopencm3/cm3/nvic.h>

#include "general.h"
#include "platform.h"
#include "usb.h"
#include "usb_descriptors.h"
#include "usb_serial.h"
Expand Down
1 change: 1 addition & 0 deletions src/platforms/common/usb_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
typedef struct stat stat_s;
#endif
#include "general.h"
#include "platform.h"
#include "gdb_if.h"
#include "usb_serial.h"
#ifdef PLATFORM_HAS_TRACESWO
Expand Down
1 change: 1 addition & 0 deletions src/platforms/stlinkv3/usbdfu.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

#include "usbdfu.h"
#include "general.h"
#include "platform.h"

uintptr_t app_address = APP_START;

Expand Down
1 change: 1 addition & 0 deletions src/remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#include <stdarg.h>
#include "general.h"
#include "platform.h"
#include "remote.h"
#include "gdb_main.h"
#include "gdb_packet.h"
Expand Down

0 comments on commit 314eec8

Please sign in to comment.