Skip to content

Commit 2c67b82

Browse files
committed
Move lib8 to a separate folder
1 parent 7462954 commit 2c67b82

File tree

11 files changed

+20
-12
lines changed

11 files changed

+20
-12
lines changed

configure.ac

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,10 @@ PKG_CHECK_MODULES([CHECK], [check >= 0.9.6])
2424

2525
# Output
2626
AC_CONFIG_HEADERS([config.h])
27-
AC_CONFIG_FILES([Makefile src/Makefile tests/Makefile])
27+
AC_CONFIG_FILES([
28+
Makefile
29+
src/Makefile
30+
src/lib8/Makefile
31+
tests/Makefile
32+
])
2833
AC_OUTPUT

src/Makefile.am

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
noinst_LIBRARIES = lib8.a
2-
lib8_a_SOURCES = cpu.c cpu.h
3-
lib8_a_CFLAGS = -std=c99 -Wall
1+
SUBDIRS = lib8 .
42

53
bin_PROGRAMS = chip8
64
chip8_SOURCES = chip8.c libsdl.c libsdl.h

src/chip8.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1717
*/
1818

19-
#include "cpu.h"
19+
#include "lib8/cpu.h"
2020
#include "libsdl.h"
21-
#include "../config.h"
21+
#include <config.h>
2222

2323
#include <getopt.h>
2424
#include <stdio.h>

src/lib8/Makefile.am

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# This Makefile builds lib8.
2+
3+
noinst_LIBRARIES = lib8.a
4+
lib8_a_SOURCES = cpu.c cpu.h
5+
lib8_a_CFLAGS = -std=c99 -Wall
File renamed without changes.
File renamed without changes.

src/libsdl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#ifndef LIBSDL_H_
2020
#define LIBSDL_H_
2121

22-
#include "cpu.h"
22+
#include "lib8/cpu.h"
2323

2424
#include <SDL.h>
2525

tests/Makefile.am

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
TESTS = chip8_test
22
check_PROGRAMS = chip8_test
33
chip8_test_SOURCES = test.c opchip.c opschip.c screen.c
4-
chip8_test_CFLAGS = -std=c99 -Wall @CHECK_CFLAGS@
5-
chip8_test_LDADD = @CHECK_LIBS@ ../src/lib8.a
4+
chip8_test_CFLAGS = -std=c99 -Wall @CHECK_CFLAGS@ -I$(top_srcdir)/src
5+
chip8_test_LDADD = @CHECK_LIBS@ $(top_srcdir)/src/lib8/lib8.a

tests/opchip.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
#include <check.h>
2525
#include <stdint.h>
26-
#include "../src/cpu.h"
26+
#include <lib8/cpu.h>
2727

2828
struct machine_t cpu;
2929

tests/opschip.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
#include <check.h>
2525
#include <stdint.h>
26-
#include "../src/cpu.h"
26+
#include <lib8/cpu.h>
2727

2828
struct machine_t cpu;
2929

0 commit comments

Comments
 (0)