【笔记(5)】工程管理器:make

工程管理器make

什么是工程?很多文件构成的软件代码---10000个.c文件如何编译?--工程管理--作用?

1.自动编译,管理代码(git/github)

2.makefile规定如何自动编译   /    按照时间戳

3.脚本文件:批处理 脚本编程--测试,运维  (python)

4.三要素:目标,依赖,命令

 

目标:依赖

tab 命令

例:

hello:hello.o

  gcc hello.o -o hello

hello.o:hello.c

  gcc -c hello.c

 

命令前加@隐藏命令

hello:hello.o

  @gcc hello.o -o hello

hello.o:hello.c

  @gcc -c hello.c

 

echo make done隐藏提示

@echo make done

 

伪目标

PHNOY:clean install

clean:

     rm -f hello

install:

     mv hello /bin

 

make -f makefile1

-f指定通过哪个makefile编译文件

 

vim add.c

int add(int a,int b)

{

    return a+b;

}

vim sub.c

int sub(int a,int b)

{

    return a-b;

}

vim mul.c

int mul(int a,int b)

{

    return a*b;

}

vim div.c

int div(int a,int b)

{

    return a/b;

}

vim main.c

#include<stdio.h>

int main()

{

    printf(“add = %d\n”,add(6,3));

    printf(“sub = %d\n”,sub(6,3));

    printf(“mul = %d\n”,mul(6,3));

    printf(“div = %d\n”,div(6,3));

}

vim makefile

add.o:add.c

   gcc -c add.c

sub.o:sub.c

   gcc -c sub.c

mul.o:mul.c

   gcc -c mul.c

div.o:div.c

   gcc -c div.c

cal:main.o add.o sub.o mul.o div.o

  gcc main.o add.o sub.o mul.o div.o

.PHONE:clean

clean:

   rm -f cal main.o add.o sub.o mul.o div.o

 

作业

.c变成.o的好处:节省编译时间

 

Makefile

1、根目录Makefile --总控的Makefile

      作用:1.进入各个功能子目录执行make命令;2.将所有.o文件链接生成可执行文件)

2、功能目录的Makefile --将src目录里的.c文件编译生成.o文件

3、Scripts的Makefile --定义变量(相当于C语言中的头文件)

项目的Makefile顺序:先看scripts的Makefile,再看总控Makefile,其次看功能目录Makefile

AI实战-出租车价格数据集分析预测实例(含20个源代码+65.69 KB完整的数据集) 代码手工整理,无语法错误,可运行。 包括:20个代码,共124.23 KB;数据大小:1个文件共65.69 KB。 使用到的模块: pandas seaborn xgboost matplotlib.pyplot sklearn.preprocessing.RobustScaler sklearn.metrics.mean_absolute_error sklearn.model_selection.GridSearchCV sklearn.model_selection.train_test_split numpy warnings joblib sklearn.set_config sklearn.impute.SimpleImputer sklearn.preprocessing.LabelEncoder sklearn.model_selection.cross_val_score sklearn.preprocessing.StandardScaler sklearn.metrics.r2_score sklearn.metrics.mean_squared_error sklearn.linear_model.LinearRegression sklearn.linear_model.Lasso sklearn.linear_model.Ridge sklearn.neighbors.KNeighborsRegressor sklearn.ensemble.RandomForestRegressor sklearn.ensemble.GradientBoostingRegressor os sklearn.preprocessing.OneHotEncoder sklearn.compose.ColumnTransformer sklearn.pipeline.Pipeline sklearn.tree.DecisionTreeRegressor sklearn.svm.SVR sklearn.neural_network.MLPRegressor bokeh.io.output_notebook bokeh.io.show bokeh.plotting.figure bokeh.layouts.gridplot sklearn.preprocessing.PolynomialFeatures scipy.stats sklearn.metrics.mean_absolute_percentage_error sklearn.ensemble.ExtraTreesRegressor xgboost.XGBRegressor lightgbm.LGBMRegressor sklearn.impute.IterativeImputer statsmodels.stats.outliers_influence.variance_inflation_factor statsmodels.api sklearn.metrics.( plotly.express psynlig.plot_correlation_heatmap bokeh.plotting.show bokeh.plotting.output_notebook catboost.CatBoostRegressor sklearn.linear_model.ElasticNet missingno
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值