-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Añadiendo script para obtener el .o con la información de las estruct…
…uras de worm añadiendo obj/ al gitignore Cambio de nombre a Makefile
- Loading branch information
Rafael Leira Osuna
committed
Jan 22, 2016
1 parent
7855eaf
commit a6792df
Showing
7 changed files
with
110 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
*.ko | ||
*.obj | ||
*.elf | ||
obj/ | ||
|
||
*.orig | ||
|
||
|
@@ -146,4 +147,4 @@ target/ | |
GPATH | ||
GRTAGS | ||
GTAGS | ||
GSYMS | ||
GSYMS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
export CC=gcc | ||
export CXX=g++ | ||
export FLAGS=-I include/ -Wall -Werror | ||
export CFLAGS=$(FLAGS) -std=c99 -fPIC | ||
export CXXFLAGS=$(FLAGS) -std=c++11 | ||
export LDFLAGS=-fPIC | ||
|
||
INCLUDES := $(wildcard include/*.h include/*.hpp) | ||
|
||
|
||
all: einstein libs | ||
|
||
einstein: obj/einstein.o | ||
|
||
lib/libworm.so: obj/worm.o obj/common.o obj/structures.h.o | ||
$(CC) $(CFLAGS) -shared -o $@ $^ $(LDFLAGS) | ||
|
||
obj: | ||
mkdir -p obj | ||
|
||
libs: lib lib/libworm.so | ||
|
||
lib: | ||
mkdir -p lib | ||
|
||
buildTools: | ||
$(MAKE) -C tools | ||
|
||
obj/%.o: src/%.cpp obj $(INCLUDES) | ||
$(CXX) $(CXXFLAGS) -c $< -o $@ | ||
|
||
obj/%.o: src/%.c obj $(INCLUDES) | ||
$(CC) $(CFLAGS) -c $< -o $@ | ||
|
||
|
||
clean: | ||
rm -rf obj lib | ||
|
||
|
||
#Custom Data .o | ||
obj/structures.h.o: $(INCLUDES) | ||
./tools/parseFile.bash > obj/structures.h | ||
objcopy --input binary --output elf64-x86-64 --binary-architecture i386 obj/structures.h $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
all: | ||
|
||
clean: | ||
#rm -rf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#include <stdio.h> | ||
|
||
|
||
int main() | ||
{ | ||
|
||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
|
||
FILES=$(ls include/*.h) | ||
|
||
|
||
for f in $FILES | ||
do | ||
flag=0 | ||
|
||
cat $f | while read in | ||
do | ||
|
||
if [[ flag -eq 0 ]] | ||
then | ||
|
||
if [[ $in == *"struct"* || $in == *"enum"* ]] | ||
then | ||
echo "${in}" | ||
flag=1 | ||
fi | ||
else | ||
echo "${in}" | ||
fi | ||
|
||
|
||
if [[ $in == *"}"* ]] | ||
then | ||
flag=0 | ||
fi | ||
|
||
done | ||
|
||
done |