Skip to content

Commit

Permalink
fixup headers, makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
joncampbell123 committed Nov 26, 2016
1 parent 7d33fb4 commit 9a2f006
Show file tree
Hide file tree
Showing 20 changed files with 76 additions and 112 deletions.
58 changes: 11 additions & 47 deletions fmt/omf/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,57 +4,21 @@ all: linux-host linux-host/omfdump
linux-host:
mkdir -p linux-host

linux-host/omfdump: linux-host/omfcstr.o linux-host/omfctx.o linux-host/omfrec.o linux-host/omfrecs.o linux-host/olnames.o linux-host/osegdefs.o linux-host/osegdeft.o linux-host/ogrpdefs.o linux-host/oextdefs.o linux-host/oextdeft.o linux-host/opubdefs.o linux-host/opubdeft.o linux-host/omledata.o linux-host/ofixupps.o linux-host/ofixuppt.o linux-host/omfdump.o
gcc -o $@ $^

linux-host/omfctx.o: omfctx.c
gcc -DLINUX -Wall -Wextra -pedantic -std=gnu99 -c -o $@ $<

linux-host/omfrec.o: omfrec.c
gcc -DLINUX -Wall -Wextra -pedantic -std=gnu99 -c -o $@ $<

linux-host/omfrecs.o: omfrecs.c
gcc -DLINUX -Wall -Wextra -pedantic -std=gnu99 -c -o $@ $<

linux-host/omfcstr.o: omfcstr.c
gcc -DLINUX -Wall -Wextra -pedantic -std=gnu99 -c -o $@ $<

linux-host/omfdump.o: omfdump.c
gcc -DLINUX -Wall -Wextra -pedantic -std=gnu99 -c -o $@ $<

linux-host/olnames.o: olnames.c
gcc -DLINUX -Wall -Wextra -pedantic -std=gnu99 -c -o $@ $<
OMFDUMP = linux-host/omfdump

linux-host/osegdefs.o: osegdefs.c
gcc -DLINUX -Wall -Wextra -pedantic -std=gnu99 -c -o $@ $<
OMFLIB = linux-host/omf.a
OMFLIB_DEPS = linux-host/omfcstr.o linux-host/omfctx.o linux-host/omfrec.o linux-host/omfrecs.o linux-host/olnames.o linux-host/osegdefs.o linux-host/osegdeft.o linux-host/ogrpdefs.o linux-host/oextdefs.o linux-host/oextdeft.o linux-host/opubdefs.o linux-host/opubdeft.o linux-host/omledata.o linux-host/ofixupps.o linux-host/ofixuppt.o

linux-host/osegdeft.o: osegdeft.c
gcc -DLINUX -Wall -Wextra -pedantic -std=gnu99 -c -o $@ $<

linux-host/oextdefs.o: oextdefs.c
gcc -DLINUX -Wall -Wextra -pedantic -std=gnu99 -c -o $@ $<

linux-host/oextdeft.o: oextdeft.c
gcc -DLINUX -Wall -Wextra -pedantic -std=gnu99 -c -o $@ $<

linux-host/ogrpdefs.o: ogrpdefs.c
gcc -DLINUX -Wall -Wextra -pedantic -std=gnu99 -c -o $@ $<

linux-host/opubdefs.o: opubdefs.c
gcc -DLINUX -Wall -Wextra -pedantic -std=gnu99 -c -o $@ $<

linux-host/opubdeft.o: opubdeft.c
gcc -DLINUX -Wall -Wextra -pedantic -std=gnu99 -c -o $@ $<

linux-host/ofixupps.o: ofixupps.c
gcc -DLINUX -Wall -Wextra -pedantic -std=gnu99 -c -o $@ $<
$(OMFDUMP): linux-host/omfdump.o $(OMFLIB)
gcc -o $@ $^

linux-host/ofixuppt.o: ofixuppt.c
gcc -DLINUX -Wall -Wextra -pedantic -std=gnu99 -c -o $@ $<
$(OMFLIB): $(OMFLIB_DEPS)
rm -f $(OMFLIB)
ar r $(OMFLIB) $(OMFLIB_DEPS)

linux-host/omledata.o: omledata.c
gcc -DLINUX -Wall -Wextra -pedantic -std=gnu99 -c -o $@ $<
linux-host/%.o : %.c
gcc -I../.. -DLINUX -Wall -Wextra -pedantic -std=gnu99 -c -o $@ $^

clean:
rm -f linux-host/omfdump linux-host/*.o
rm -f linux-host/omfdump linux-host/*.o linux-host/*.a

4 changes: 2 additions & 2 deletions fmt/omf/oextdefs.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

#include "omfcstr.h"
#include "oextdefs.h"
#include <fmt/omf/omfcstr.h>
#include <fmt/omf/oextdefs.h>

void omf_extdefs_context_init_extdef(struct omf_extdef_t * const ctx) {
ctx->type = OMF_EXTDEF_TYPE_LOCAL;
Expand Down
2 changes: 1 addition & 1 deletion fmt/omf/oextdeft.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

#include "oextdefs.h"
#include <fmt/omf/oextdefs.h>

const char *omf_extdef_type_to_string(const unsigned char t) {
switch (t) {
Expand Down
2 changes: 1 addition & 1 deletion fmt/omf/ofixupps.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

#include "ofixupps.h"
#include <fmt/omf/ofixupps.h>

void omf_fixupps_clear_thread(struct omf_fixupp_thread_t * const th) {
th->method = 0;
Expand Down
4 changes: 2 additions & 2 deletions fmt/omf/ofixuppt.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

#include "ofixupps.h"
#include "ofixuppt.h"
#include <fmt/omf/ofixupps.h>
#include <fmt/omf/ofixuppt.h>

const char *omf_fixupp_location_to_str(const unsigned char loc) {
switch (loc) {
Expand Down
2 changes: 1 addition & 1 deletion fmt/omf/ogrpdefs.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

#include "ogrpdefs.h"
#include <fmt/omf/ogrpdefs.h>

void omf_grpdefs_context_init(struct omf_grpdefs_context_t * const ctx) {
ctx->segdefs = NULL;
Expand Down
4 changes: 2 additions & 2 deletions fmt/omf/olnames.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

#include "omfcstr.h"
#include "olnames.h"
#include <fmt/omf/omfcstr.h>
#include <fmt/omf/olnames.h>

void omf_lnames_context_init(struct omf_lnames_context_t * const ctx) {
ctx->omf_LNAMES = NULL;
Expand Down
2 changes: 1 addition & 1 deletion fmt/omf/olnames.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#ifndef _DOSLIB_OMF_OLNAMES_H
#define _DOSLIB_OMF_OLNAMES_H

#include "omfrec.h"
#include <fmt/omf/omfrec.h>

/* LNAMES collection */
struct omf_lnames_context_t {
Expand Down
2 changes: 1 addition & 1 deletion fmt/omf/omfcstr.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

#include "omfcstr.h"
#include <fmt/omf/omfcstr.h>

void cstr_free(char ** const p) {
if (*p != NULL) {
Expand Down
30 changes: 15 additions & 15 deletions fmt/omf/omfctx.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@
#include <fcntl.h>
#include <stdio.h>

#include "omfrecs.h"
#include "omfcstr.h"
#include "omfrec.h"
#include "olnames.h"
#include "osegdefs.h"
#include "osegdeft.h"
#include "ogrpdefs.h"
#include "oextdefs.h"
#include "oextdeft.h"
#include "opubdefs.h"
#include "opubdeft.h"
#include "omledata.h"
#include "ofixupps.h"
#include "ofixuppt.h"
#include "omfctx.h"
#include <fmt/omf/omfrecs.h>
#include <fmt/omf/omfcstr.h>
#include <fmt/omf/omfrec.h>
#include <fmt/omf/olnames.h>
#include <fmt/omf/osegdefs.h>
#include <fmt/omf/osegdeft.h>
#include <fmt/omf/ogrpdefs.h>
#include <fmt/omf/oextdefs.h>
#include <fmt/omf/oextdeft.h>
#include <fmt/omf/opubdefs.h>
#include <fmt/omf/opubdeft.h>
#include <fmt/omf/omledata.h>
#include <fmt/omf/ofixupps.h>
#include <fmt/omf/ofixuppt.h>
#include <fmt/omf/omfctx.h>

char omf_temp_str[255+1/*NUL*/];

Expand Down
28 changes: 14 additions & 14 deletions fmt/omf/omfctx.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@
#include <fcntl.h>
#include <stdio.h>

#include "omfrecs.h"
#include "omfcstr.h"
#include "omfrec.h"
#include "olnames.h"
#include "osegdefs.h"
#include "osegdeft.h"
#include "ogrpdefs.h"
#include "oextdefs.h"
#include "oextdeft.h"
#include "opubdefs.h"
#include "opubdeft.h"
#include "omledata.h"
#include "ofixupps.h"
#include "ofixuppt.h"
#include <fmt/omf/omfrecs.h>
#include <fmt/omf/omfcstr.h>
#include <fmt/omf/omfrec.h>
#include <fmt/omf/olnames.h>
#include <fmt/omf/osegdefs.h>
#include <fmt/omf/osegdeft.h>
#include <fmt/omf/ogrpdefs.h>
#include <fmt/omf/oextdefs.h>
#include <fmt/omf/oextdeft.h>
#include <fmt/omf/opubdefs.h>
#include <fmt/omf/opubdeft.h>
#include <fmt/omf/omledata.h>
#include <fmt/omf/ofixupps.h>
#include <fmt/omf/ofixuppt.h>

extern char omf_temp_str[255+1/*NUL*/];

Expand Down
30 changes: 15 additions & 15 deletions fmt/omf/omfdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@
#include <fcntl.h>
#include <stdio.h>

#include "omfrecs.h"
#include "omfcstr.h"
#include "omfrec.h"
#include "olnames.h"
#include "osegdefs.h"
#include "osegdeft.h"
#include "ogrpdefs.h"
#include "oextdefs.h"
#include "oextdeft.h"
#include "opubdefs.h"
#include "opubdeft.h"
#include "omledata.h"
#include "ofixupps.h"
#include "ofixuppt.h"
#include "omfctx.h"
#include <fmt/omf/omfrecs.h>
#include <fmt/omf/omfcstr.h>
#include <fmt/omf/omfrec.h>
#include <fmt/omf/olnames.h>
#include <fmt/omf/osegdefs.h>
#include <fmt/omf/osegdeft.h>
#include <fmt/omf/ogrpdefs.h>
#include <fmt/omf/oextdefs.h>
#include <fmt/omf/oextdeft.h>
#include <fmt/omf/opubdefs.h>
#include <fmt/omf/opubdeft.h>
#include <fmt/omf/omledata.h>
#include <fmt/omf/ofixupps.h>
#include <fmt/omf/ofixuppt.h>
#include <fmt/omf/omfctx.h>

#ifndef O_BINARY
#define O_BINARY (0)
Expand Down
2 changes: 1 addition & 1 deletion fmt/omf/omfrec.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

#include "omfrec.h"
#include <fmt/omf/omfrec.h>

unsigned char omf_record_is_modend(const struct omf_record_t * const rec) {
return ((rec->rectype&0xFE) == 0x8A); // MODEND 0x8A or 0x8B
Expand Down
2 changes: 1 addition & 1 deletion fmt/omf/omledata.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

#include "omledata.h"
#include <fmt/omf/omledata.h>

int omf_ledata_parse_header(struct omf_ledata_info_t * const info,struct omf_record_t * const rec) {
info->data = NULL;
Expand Down
2 changes: 1 addition & 1 deletion fmt/omf/omledata.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#ifndef _DOSLIB_OMF_OMLEDATA_H
#define _DOSLIB_OMF_OMLEDATA_H

#include "omfrec.h"
#include <fmt/omf/omfrec.h>

// this is filled in by a utility function after reading the OMF record from the beginning.
// the data pointer is valid UNTIL the OMF record is overwritten/rewritten, so take the
Expand Down
4 changes: 2 additions & 2 deletions fmt/omf/opubdefs.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

#include "omfcstr.h"
#include "opubdefs.h"
#include <fmt/omf/omfcstr.h>
#include <fmt/omf/opubdefs.h>

void omf_pubdefs_context_init_pubdef(struct omf_pubdef_t * const ctx) {
ctx->group_index = 0;
Expand Down
2 changes: 1 addition & 1 deletion fmt/omf/opubdeft.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

#include "opubdefs.h"
#include <fmt/omf/opubdefs.h>

const char *omf_pubdef_type_to_string(const unsigned char t) {
switch (t) {
Expand Down
2 changes: 1 addition & 1 deletion fmt/omf/osegdefs.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

#include "osegdefs.h"
#include <fmt/omf/osegdefs.h>

void omf_segdefs_context_init_segdef(struct omf_segdef_t *s) {
memset(s,0,sizeof(*s));
Expand Down
2 changes: 1 addition & 1 deletion fmt/omf/osegdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <fcntl.h>
#include <stdio.h>

#include "omfrec.h"
#include <fmt/omf/omfrec.h>

enum {
OMF_SEGDEF_ALIGN_ABSOLUTE=0,
Expand Down
4 changes: 2 additions & 2 deletions fmt/omf/osegdeft.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

#include "osegdefs.h"
#include "osegdeft.h"
#include <fmt/omf/osegdefs.h>
#include <fmt/omf/osegdeft.h>

const char *omf_segdefs_alignment_to_str(const unsigned char a) {
switch (a) {
Expand Down

0 comments on commit 9a2f006

Please sign in to comment.