Revision 1e73dd2a

View differences:

custompackages/graph-parser/src/Makefile
19 19
OBJS = $(SRCS:.cpp=.o)
20 20

  
21 21
MAIN = main
22
BIN_FILE = graph-parser
22 23

  
23 24
# all: ../bin/$(MAIN)
24 25
# 	@echo  Simple compiler named main has been compiled
25 26

  
26 27
$(MAIN): $(OBJS)
27
	$(CXX) $(CFLAGS) $(INCLUDES) -o ../bin/$(MAIN) $(OBJS) $(LFLAGS) $(LIBS )
28
	$(CXX) $(CFLAGS) $(INCLUDES) -o $(BIN_FILE) $(OBJS) $(LFLAGS) $(LIBS )
28 29

  
29 30
# this is a suffix replacement rule for building .o's from .c's
30 31
# it uses automatic variables $<: the name of the prerequisite of
......
35 36

  
36 37
# remove object files and executable when user executes "make clean"
37 38
clean:
38
	$(RM) *.o ../bin/$(MAIN)
39
	$(RM) *.o $(BIN_FILE)
custompackages/graph-parser/src/Makefile_openwrt
1
##############################################
2
# Makefile for graph-parser program
3
# This Makefile is used with OpenWRT. Therefore
4
# no $INCLUDES is defined.
5
# The BGL will be linked with the BGL in OpenWRT
6
##############################################
7

  
8
# define the C source files
9
SRCS = main.cpp bi_connected_components.cpp graph_manager.cpp parser.cpp sub_component.cpp utility.cpp
10

  
11

  
12
# define the C object files
13
#
14
# This uses Suffix Replacement within a macro:
15
#   $(name:string1=string2)
16
#         For each word in 'name' replace 'string1' with 'string2'
17
# Below we are replacing the suffix .c of all words in the macro SRCS
18
# with the .o suffix
19
#
20
OBJS = $(SRCS:.cpp=.o)
21

  
22
MAIN = main
23
BIN_FILE = graph-parser
24

  
25
# all: ../bin/$(MAIN)
26
# 	@echo  Simple compiler named main has been compiled
27

  
28
$(MAIN): $(OBJS)
29
	$(CXX) $(CFLAGS) $(OBJS) $(LFLAGS) -o $(BIN_FILE)
30

  
31
# this is a suffix replacement rule for building .o's from .c's
32
# it uses automatic variables $<: the name of the prerequisite of
33
# the rule(a .c file) and $@: the name of the target of the rule (a .o file)
34
# (see the gnu make manual section about automatic variables)
35
.cpp.o:
36
	$(CXX) $(CFLAGS) -std=c++11 -c $<  -o $@
37

  
38
# remove object files and executable when user executes "make clean"
39
clean:
40
	$(RM) *.o $(BIN_FILE)
custompackages/move_code_to_sdk.sh
1
# SDK_DIR="/home/quynh/Thesis/sdk/OpenWrt-SDK-15.05-realview_gcc-4.8-linaro_uClibc-0.9.33.2_eabi.Linux-x86_64"/
2
# cp -r libboost $SDK_DIR/package
3

  
4
TOOLCHAIN_DIR="/home/quynh/Thesis/cc-openwrt"
5
BASE_DIR='graph-parser'
6
DIR=$TOOLCHAIN_DIR/package/custom/$BASE_DIR
7

  
8
if [ -d "$DIR" ]; then
9
    rm -r "$DIR";
10
fi
11

  
12
mkdir $DIR
13
cp $BASE_DIR/Makefile $DIR/Makefile
14

  
15
mkdir $DIR/src
16
cp $BASE_DIR/src/*.h $DIR/src
17
cp $BASE_DIR/src/*.cpp $DIR/src
18
cp $BASE_DIR/src/*.tpp $DIR/src
19
cp $BASE_DIR/src/Makefile_openwrt $DIR/src/Makefile
20

  
21
cp -r $BASE_DIR/input $DIR
scripts/compile_toolchain.sh
6 6
_now="$(date +'%Y_%m_%d_%H_%M')"
7 7
_dirname=$_description$_separator$_now
8 8
./scripts/diffconfig.sh > $MAIN_DIR/config.diff
9

  
9 10
make
11

  
10 12
BIN_DIR="$MAIN_DIR/bin/realview"
11
cd $BIN_DIR 
13
cd $BIN_DIR
12 14
echo $(pwd)
13 15
mkdir $_dirname
14 16

  
......
22 24

  
23 25
# find . -maxdepth 1 -type f -name '*' -exec mv -n {} ./$_now \;
24 26
echo "All binary files are in ./bin/realview/$_dirname"
25
ELF_FILE_PATH=$BIN_DIR$_dirname"/openwrt-realview-vmlinux-initramfs.elf"
26
qemu-system-arm -M realview-eb-mpcore -kernel $ELF_FILE_PATH -net nic -net user -nographic
27
# ELF_FILE_PATH=$BIN_DIR$_dirname"/openwrt-realview-vmlinux-initramfs.elf"
28
# qemu-system-arm -M realview-eb-mpcore -kernel $ELF_FILE_PATH -net nic -net user -nographic

Also available in: Unified diff