Commit 33747a02e5acf73fb43bd9c45b0e0cfb90367b0e
1 parent
2af70d65
Exists in
master
Cria os arquivos Makefile
Showing
8 changed files
with
73 additions
and
1 deletions
Show diff stats
| ... | ... | @@ -0,0 +1,34 @@ |
| 1 | +include Makefile.top | |
| 2 | + | |
| 3 | +MODULE = vlibras_desktop | |
| 4 | +LIBNAME = CorePlugin | |
| 5 | + | |
| 6 | +VERSION = 0.2 | |
| 7 | + | |
| 8 | +CFLAGS = \ | |
| 9 | + -I$(INCDIR)\ | |
| 10 | + -I/usr/include/python2.7 | |
| 11 | + | |
| 12 | +CFLAGS += -m32 -g -fPIC | |
| 13 | + | |
| 14 | +LDFLAGS = \ | |
| 15 | + -L/usr/lib/python2.7/config\ | |
| 16 | + -lpthread\ | |
| 17 | + -ldl\ | |
| 18 | + -lutil\ | |
| 19 | + -lm\ | |
| 20 | + -lpython2.7 | |
| 21 | + | |
| 22 | +HEADERS = \ | |
| 23 | + py_tradutor.h\ | |
| 24 | + core_plugin.h | |
| 25 | + | |
| 26 | +SOURCES = \ | |
| 27 | + py_tradutor.cpp\ | |
| 28 | + core_plugin.cpp | |
| 29 | + | |
| 30 | +.SUFFIXES: .cpp .o .h | |
| 31 | + | |
| 32 | +include Makefile.build | |
| 33 | + | |
| 34 | +default: all | ... | ... |
| ... | ... | @@ -0,0 +1,24 @@ |
| 1 | +OBJS = $(SOURCES:.cpp=.o) | |
| 2 | +LIB = lib$(LIBNAME)-$(VERSION).so | |
| 3 | + | |
| 4 | +all: shared | |
| 5 | + | |
| 6 | +shared: $(addprefix $(SRCDIR),$(OBJS)) | |
| 7 | + @mkdir $(PLUGINDIR) > /dev/null 2>&1 && \ | |
| 8 | + echo "Create directory $(PLUGINDIR)... $(OK)" || echo -n "" | |
| 9 | + @echo -n Linking $(LIB) ... | |
| 10 | + @$(CC) -shared -o $(PLUGINDIR)$(LIB) $(addprefix $(SRCDIR),$(OBJS)) $(LDFLAGS) || \ | |
| 11 | + (echo " $(FAILED)"; exit 1;) | |
| 12 | + @cd $(PLUGINDIR); \ | |
| 13 | + ln -f -s $(LIB) lib$(LIBNAME).so; \ | |
| 14 | + cd .. && echo " $(OK)" || (echo " $(FAILED)"; exit 1;) | |
| 15 | + | |
| 16 | +%.o: %.cpp | |
| 17 | + @echo -n Compiling file $(notdir $<) to $(notdir $@) ... | |
| 18 | + @$(CXX) $(CFLAGS) -c $< -o $@ && \ | |
| 19 | + echo " $(OK)" || (echo " $(FAILED)"; exit 1;) | |
| 20 | + | |
| 21 | +clean: | |
| 22 | + @echo -n Cleaning... | |
| 23 | + @rm -rf $(addprefix $(SRCDIR),$(OBJS)) $(PLUGINDIR) 2> /dev/null && \ | |
| 24 | + echo " $(OK)" || (echo " $(FAILED)"; exit 1;) | ... | ... |
README
| ... | ... | @@ -5,7 +5,7 @@ COMPILE |
| 5 | 5 | $ g++ -Iinclude/ -I/usr/include/python2.7 -g -c src/py_tradutor.cpp src/core_plugin.cpp -fPIC -Wall |
| 6 | 6 | |
| 7 | 7 | -------------------------------------------- |
| 8 | -BUILD EXECUTABLE | |
| 8 | +BUILD SHARED LIBRARY (.so) | |
| 9 | 9 | -------------------------------------------- |
| 10 | 10 | |
| 11 | 11 | $ g++ -shared -fPIC py_tradutor.o core_plugin.o $(python2.7-config --ldflags) -o libCorePlugin.so -lm | ... | ... |
No preview for this file type
No preview for this file type
No preview for this file type