Skip to content

Commit

Permalink
Move files in src to src/linux.
Browse files Browse the repository at this point in the history
  • Loading branch information
kubo committed Jun 17, 2018
1 parent 3af6b81 commit 470d37c
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 30 deletions.
4 changes: 2 additions & 2 deletions .gitignore
@@ -1,8 +1,8 @@
*~
*.o
/cmd/injector
/src/libinjector.a
/src/libinjector.so
/src/linux/libinjector.a
/src/linux/libinjector.so
/tests/test-library.so
/tests/test-library-*.so
/tests/test-prog
Expand Down
4 changes: 2 additions & 2 deletions Makefile
@@ -1,11 +1,11 @@
all:
cd src && make
cd src/linux && make
cd cmd && make

check:
cd tests && make check

clean:
cd src && make clean
cd src/linux && make clean
cd cmd && make clean
cd tests && make clean
8 changes: 4 additions & 4 deletions cmd/Makefile
Expand Up @@ -2,13 +2,13 @@ CFLAGS = -Wall -I../include

all: injector

injector: main.o ../src/libinjector.a
$(CC) -o injector main.o ../src/libinjector.a
injector: main.o ../src/linux/libinjector.a
$(CC) -o injector main.o ../src/linux/libinjector.a

main.o: main.c

../src/libinjlib.a:
cd ../src && make
../src/linux/libinjlib.a:
cd ../src/linux && make

clean:
$(RM) injector main.o
19 changes: 0 additions & 19 deletions src/Makefile

This file was deleted.

19 changes: 19 additions & 0 deletions src/linux/Makefile
@@ -0,0 +1,19 @@
INJECTOR_OBJS = elf.o injector.o ptrace.o remote_call.o util.o
CFLAGS = -Wall -fPIC -I../../include

all: libinjector.so libinjector.a

libinjector.so: $(INJECTOR_OBJS)
$(CC) -shared -o libinjector.so $(INJECTOR_OBJS)

libinjector.a: $(INJECTOR_OBJS)
$(AR) rcs libinjector.a $(INJECTOR_OBJS)

elf.o: elf.c injector_internal.h ../../include/injector.h
injector.o: injector.c injector_internal.h ../../include/injector.h
ptrace.o: ptrace.c injector_internal.h ../../include/injector.h
remote_call.o: remote_call.c injector_internal.h ../../include/injector.h
util.o: util.c injector_internal.h ../../include/injector.h

clean:
$(RM) libinjector.so libinjector.a $(INJECTOR_OBJS)
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/injector_internal.h → src/linux/injector_internal.h
Expand Up @@ -31,7 +31,7 @@
#include <sys/user.h>
#include <sys/ptrace.h>
#include <errno.h>
#include "../include/injector.h"
#include "injector.h"

#ifdef __LP64__
#define SIZE_T_FMT "l"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/Makefile
Expand Up @@ -78,8 +78,8 @@ armel:
build: test-prog$(SUFFIX) test-target$(SUFFIX) test-library$(SUFFIX).so

test-prog$(SUFFIX): test-prog.c
cd ../src && make clean && make
$(LINK_PROG) -o $@ $^ ../src/libinjector.a
cd ../src/linux && make clean && make
$(LINK_PROG) -o $@ $^ ../src/linux/libinjector.a

test-target$(SUFFIX): test-target.c
$(LINK_TARGET) -o $@ $^
Expand Down

0 comments on commit 470d37c

Please sign in to comment.