使用eclipse 建立C++項目,daemon service 程序。 mysql
編譯時,eclipse自動生成的makefile: linux
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
-include ../makefile.init
RM := rm -rf
# All of the sources participating in the build are defined here
-include sources.mk
-include subdir.mk
-include objects.mk
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(strip $(C++_DEPS)),)
-include $(C++_DEPS)
endif
ifneq ($(strip $(C_DEPS)),)
-include $(C_DEPS)
endif
ifneq ($(strip $(CC_DEPS)),)
-include $(CC_DEPS)
endif
ifneq ($(strip $(CPP_DEPS)),)
-include $(CPP_DEPS)
endif
ifneq ($(strip $(CXX_DEPS)),)
-include $(CXX_DEPS)
endif
ifneq ($(strip $(C_UPPER_DEPS)),)
-include $(C_UPPER_DEPS)
endif
endif
-include ../makefile.defs
# Add inputs and outputs from these tool invocations to the build variables
# All Target
all: ck
# Tool invocations
ck: $(OBJS) $(USER_OBJS)
@echo 'Building target: $@'
@echo 'Invoking: GCC C++ Linker'
g++ -L"/mysql-connector-c-6.0.2-linux-glibc2.3-x86-32bit/lib}" -L"/home/acer/workspace/ck/mysql-connector-c-6.0.2-linux-glibc2.3-x86-32bit/lib" -o"ck" $(OBJS) $(USER_OBJS) $(LIBS)
@echo 'Finished building target: $@'
@echo ' '
# Other Targets
clean:
-$(RM) $(OBJS)$(C++_DEPS)$(C_DEPS)$(CC_DEPS)$(CPP_DEPS)$(EXECUTABLES)$(CXX_DEPS)$(C_UPPER_DEPS) ck
-@echo ' '
.PHONY: all clean dependents
.SECONDARY:
-include ../makefile.targets sql
install: eclipse
-$(cp) .....
############################################### ui
還有objects.mk ,內容包含項目使用的庫: spa
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
USER_OBJS :=
LIBS := -lmysqlclient
.net
#################################### ip
還有sources.mk : ci
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
O_SRCS :=
CPP_SRCS :=
C_UPPER_SRCS :=
C_SRCS :=
S_UPPER_SRCS :=
OBJ_SRCS :=
ASM_SRCS :=
CXX_SRCS :=
C++_SRCS :=
CC_SRCS :=
OBJS :=
C++_DEPS :=
C_DEPS :=
CC_DEPS :=
CPP_DEPS :=
EXECUTABLES :=
CXX_DEPS :=
C_UPPER_DEPS :=
# Every subdirectory with source files must be described here
SUBDIRS := \
. \
get
還有subdir.mk,包含項目須要編譯的cpp文件 :
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
CPP_SRCS += \
../become_daemon.cpp \
../cksettling.cpp \
../dbdo.cpp \
../log.cpp \
../tools.cpp
OBJS += \
./become_daemon.o \
./cksettling.o \
./dbdo.o \
./log.o \
./tools.o
CPP_DEPS += \
./become_daemon.d \
./cksettling.d \
./dbdo.d \
./log.d \
./tools.d
# Each subdirectory must supply rules for building sources it contributes
%.o: ../%.cpp
@echo 'Building file: $<'
@echo 'Invoking: GCC C++ Compiler'
g++ -I"/mysql-connector-c-6.0.2-linux-glibc2.3-x86-32bit/include}" -I"/home/acer/workspace/ck/mysql-connector-c-6.0.2-linux-glibc2.3-x86-32bit/include" -O0 -g3 -D_DEBUG -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<"
@echo 'Finished building: $<'
@echo ' ' 經過修改這幾個mk文件和makefile文件,就能夠執行 make clean && make && make install 了;