Skip to content

Commit 2d734eb

Browse files
committed
Update build rules.
1. Add autoconf build script. 2. Remove MS-DOS support. 3. Remove CMake build rules. 4. Fix bugs. 5. Update docs. 6. Remove Python build script. 修改: .gitignore 删除: CMakeLists.txt 删除: Makefile 新文件: Makefile.devel 新文件: Makefile.in 修改: README.md 新文件: build-aux/install-sh 新文件: build-aux/mkinstalldirs 新文件: configure.ac 重命名: doc/archs.md -> doc/architectures.md 修改: doc/compilers.md 修改: doc/doc.md 重命名: doc/stds.md -> doc/languagestandards.md 修改: doc/platforms.md 重命名: src/title.h -> include/libplatform.h.in 重命名: src/lparchs.h -> include/platform_predef/architectures.h 重命名: src/lpcomps.h -> include/platform_predef/compilers.h 重命名: src/lpstds.h -> include/platform_predef/languagestandards.h 重命名: src/lpplat.h -> include/platform_predef/platforms.h 新文件: m4/readfile.m4 删除: make.cmd 删除: src/_lpcomps_make.py 删除: src/end.h 删除: tools/build.py 删除: tools/dos-make.bat
1 parent a21a0cc commit 2d734eb

25 files changed

+1150
-923
lines changed

.gitignore

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
1-
# libplatform .gitignore
2-
# Build output dir
1+
# Libplatform's gitignore
2+
3+
# Build output directory
34
build/
4-
# Editor config
5+
6+
# Editor profile directory
57
.vscode/
6-
# Makefile install data
7-
install.list
8+
9+
# Autoconf temps
10+
autom4te.cache/
11+
aclocal.m4
12+
configure
13+
14+
# Configure outputs
15+
config.log
16+
config.status
17+
18+
# Build outputs
19+
include/libplatform.h
20+
Makefile

CMakeLists.txt

Lines changed: 0 additions & 26 deletions
This file was deleted.

Makefile

Lines changed: 0 additions & 61 deletions
This file was deleted.

Makefile.devel

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# -*- makefile -*-
2+
# This is the developer's makefile.
3+
4+
AUTOCONF = autoconf
5+
ACLOCAL = aclocal
6+
7+
CONFIGURES = configure
8+
CONFIGURES_IN = configure.ac
9+
AUTOCONF_FILES = aclocal.m4 $(wildcard m4/*.m4)
10+
11+
all : aclocal.m4 configure
12+
13+
aclocal.m4 : $(CONFIGURES_IN) $(wildcard m4/*.m4)
14+
$(ACLOCAL) -I m4 --output=$@ && touch $@ && $(RM) -rf autom4te.cache
15+
16+
configure : configure.ac $(AUTOCONF_FILES)
17+
$(AUTOCONF) && $(RM) -rf autom4te.cache

Makefile.in

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Makefile for libplatform
2+
3+
#### Start of system configuration section. ####
4+
5+
# Directories used by "make install":
6+
prefix = @prefix@
7+
includedir = @includedir@/cppp
8+
9+
# Programs used by "make install":
10+
INSTALL = @INSTALL@
11+
INSTALL_DATA = @INSTALL_DATA@
12+
mkinstalldirs = $(SHELL) @top_srcdir@/build-aux/mkinstalldirs
13+
14+
all : force
15+
16+
install : force
17+
if [ ! -d $(DESTDIR)$(includedir) ] ; then $(mkinstalldirs) $(DESTDIR)$(includedir) ; fi
18+
$(INSTALL_DATA) include/libplatform.h $(DESTDIR)$(includedir)/libplatform.h
19+
20+
installdirs : force
21+
if [ ! -d $(DESTDIR)$(includedir) ] ; then $(mkinstalldirs) $(DESTDIR)$(includedir) ; fi
22+
23+
uninstall : force
24+
$(RM) $(DESTDIR)$(includedir)/libplatform.h
25+
26+
clean : force
27+
28+
force :
29+
30+
# Work around an automake-1.8 bug.
31+
am--refresh:

README.md

Lines changed: 5 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,17 @@
1-
# libplatform
2-
libplatform is a platform check library
1+
# Introduction
2+
libplatform is a portable platform check library for C++ Plus
33
## Build
44
### Build with GNU Makefile
55
#### Dependence
66
+ GNU Make
7-
+ GNU/Linux commands: **cat, mkdir, install, rm, echo**
7+
+ GNU/Linux commands: **cat, mkdir, install, rm**
88
#### Make and Install
99
```shell
10+
./configure
1011
make
1112
make install
1213
```
1314
The build results are in the 'build' directory.
14-
### Build on Windows
15-
#### Dependence
16-
+ cmd.exe on Windows
17-
#### Make
18-
```shell
19-
call make.cmd
20-
```
21-
make.cmd does not support install.
22-
The build results are in the 'build' directory.
2315
### Build with CMake
2416
#### Dependence
2517
+ CMake (version >= 3.0)
@@ -30,37 +22,11 @@ cd build
3022
cmake ..
3123
```
3224
The build results are in the 'build' directory.
33-
### Build with Python
34-
#### Dependence
35-
+ Python 3.x or Python 2.x
36-
+ Python base libraries (platform, shutil)
37-
+ Python build-in libraries (sys, os)
38-
#### Make and Install
39-
```shell
40-
python tools/build.py
41-
python tools/build.py install
42-
```
43-
Try 'python tools/build.py' --help for help
44-
### Build on MS-DOS
45-
**MS-DOS does not support long file names, so include output 'include\platform_predef.h' will be replaced to 'include\libplat.h'**
46-
#### Dependence
47-
+ MS-DOS shell (COMMAND.COM)
48-
#### Make and Install
49-
```shell
50-
cd tools
51-
call dos-make.bat
52-
```
53-
dos-make.bat will chdir to repository root directory automatic.
54-
dos-make.bat does not support install.
55-
The build results are in the 'build' directory.
56-
57-
**Do not use dos-make.bat for build on Windows!**
5825

5926
## Usage
6027
After install, you can use libplatform in C/C++
6128
```c
62-
#include <platform_predef.h>
63-
/*On MS-DOS, <platform_predef.h> is renamed to <libplat.h>*/
29+
#include <cppp/libplatform.h>
6430
#include <stdio.h>
6531
int main()
6632
{

0 commit comments

Comments
 (0)