Skip to content

Commit

Permalink
Make include path more explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
whampson committed Jun 16, 2019
1 parent d846660 commit 4af78c6
Show file tree
Hide file tree
Showing 14 changed files with 34 additions and 34 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ file(GLOB LIB_SOURCES "src/lib/*.c")
file(GLOB AS_SOURCES "src/as/*.c")
file(GLOB EMU_SOURCES "src/emu/*.c")

# Include directories
include_directories("include/")

# Library for shared code
add_library(lc3tools ${LIB_SOURCES})
target_include_directories(lc3tools PUBLIC include)

# Executables
add_executable(lc3as ${AS_SOURCES})
add_executable(lc3emu ${EMU_SOURCES})
target_include_directories(lc3as PRIVATE include/as)
target_include_directories(lc3emu PRIVATE include/emu)

# Link shared code and executables
target_link_libraries(lc3as lc3tools)
Expand Down
2 changes: 1 addition & 1 deletion include/emu/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#ifndef __CPU_H
#define __CPU_H

#include <lc3.h>
#include <emu/lc3.h>

/*
* Reset the CPU.
Expand Down
2 changes: 1 addition & 1 deletion include/emu/disp.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#ifndef __DISP_H
#define __DISP_H

#include <lc3.h>
#include <emu/lc3.h>

/*
* Display IRQ line (interrupt priority).
Expand Down
2 changes: 1 addition & 1 deletion include/emu/kbd.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#ifndef __KBD_H
#define __KBD_H

#include <lc3.h>
#include <emu/lc3.h>

/*
* Keyboard IRQ line (interrupt priority).
Expand Down
2 changes: 1 addition & 1 deletion include/emu/mem.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#ifndef __MEM_H
#define __MEM_H

#include <lc3.h>
#include <emu/lc3.h>

/*
* Memory size in bytes.
Expand Down
2 changes: 1 addition & 1 deletion include/emu/pic.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#ifndef __PIC_H
#define __PIC_H

#include <lc3.h>
#include <emu/lc3.h>

/*
* Device interrupt service routine base vector.
Expand Down
2 changes: 1 addition & 1 deletion include/emu/state.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#ifndef __STATE_H
#define __STATE_H

#include <lc3.h>
#include <emu/lc3.h>

void state_00(void);
void state_01(void);
Expand Down
2 changes: 1 addition & 1 deletion src/as/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#include <stdlib.h>
#include <string.h>

#include <lc3as.h>
#include <lc3tools.h>
#include <as/lc3as.h>

#define LINE_BUFFER_SIZE 512
#define TOKEN_BUFFER_SIZE 64
Expand Down
14 changes: 7 additions & 7 deletions src/emu/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
#include <stdio.h>
#include <string.h>

#include <lc3.h>
#include <cpu.h>
#include <state.h>
#include <mem.h>
#include <kbd.h>
#include <disp.h>
#include <pic.h>
#include <emu/lc3.h>
#include <emu/cpu.h>
#include <emu/state.h>
#include <emu/mem.h>
#include <emu/kbd.h>
#include <emu/disp.h>
#include <emu/pic.h>

/******
* TODO:
Expand Down
4 changes: 2 additions & 2 deletions src/emu/disp.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
#include <stdio.h>
#include <string.h>

#include <disp.h>
#include <pic.h>
#include <emu/disp.h>
#include <emu/pic.h>

#define RD() (disp.dsr & DSR_RD)
#define SET_RD(x) (disp.dsr = (x)?(disp.dsr|DSR_RD):(disp.dsr&~DSR_RD))
Expand Down
4 changes: 2 additions & 2 deletions src/emu/kbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
#include <string.h>

#include <lc3tools.h>
#include <kbd.h>
#include <pic.h>
#include <emu/kbd.h>
#include <emu/pic.h>

#define RD() (kbd.kbsr & KBSR_RD)
#define SET_RD(x) (kbd.kbsr = (x)?(kbd.kbsr|KBSR_RD):(kbd.kbsr&~KBSR_RD))
Expand Down
12 changes: 6 additions & 6 deletions src/emu/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
#include <string.h>

#include <lc3tools.h>
#include <lc3.h>
#include <cpu.h>
#include <mem.h>
#include <kbd.h>
#include <disp.h>
#include <pic.h>
#include <emu/lc3.h>
#include <emu/cpu.h>
#include <emu/mem.h>
#include <emu/kbd.h>
#include <emu/disp.h>
#include <emu/pic.h>

/* Instruction encodings */
#define _NOP 0
Expand Down
10 changes: 5 additions & 5 deletions src/emu/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@

#include <stdio.h>

#include <mem.h>
#include <cpu.h>
#include <kbd.h>
#include <disp.h>
#include <pic.h>
#include <emu/mem.h>
#include <emu/cpu.h>
#include <emu/kbd.h>
#include <emu/disp.h>
#include <emu/pic.h>

/*
* Overwrite the bits of a value based on a write mask.
Expand Down
4 changes: 2 additions & 2 deletions src/emu/pic.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

#include <string.h>

#include <pic.h>
#include <cpu.h>
#include <emu/pic.h>
#include <emu/cpu.h>

#define SET_BIT(val,pos) (val|=(1 <<(pos)))
#define CLEAR_BIT(val,pos) (val&=~(1 <<(pos)))
Expand Down

0 comments on commit 4af78c6

Please sign in to comment.