update makefile

This commit is contained in:
Alfie King 2024-10-21 12:45:34 +01:00
parent e597d59cb2
commit 9c299777d3
6 changed files with 24 additions and 36 deletions

View File

@ -1,19 +0,0 @@
pkgbase = term-owo-git
pkgdesc = A simple C++ program that owofies text
pkgver = 1.0
pkgrel = 1
url = https://git.alfieking.dev/acetheking987/term-owo-cpp
arch = x86_64
arch = i686
arch = arm
arch = armv6h
arch = armv7h
arch = aarch64
license = MIT
makedepends = cmake
makedepends = git
makedepends = gcc
source = git+https://git.alfieking.dev/acetheking987/term-owo-cpp.git
md5sums = SKIP
pkgname = term-owo-git

1
.gitignore vendored
View File

@ -32,4 +32,5 @@
*.out
*.app
# Build files
build/

View File

@ -1,7 +0,0 @@
{
"files.associations": {
"*.pyw": "python",
"string": "cpp",
"ostream": "cpp"
}
}

View File

@ -1,7 +0,0 @@
cmake_minimum_required(VERSION 3.5)
find_program(CMAKE_C_COMPILER NAMES $ENV{CC} gcc PATHS ENV PATH NO_DEFAULT_PATH)
find_program(CMAKE_CXX_COMPILER NAMES $ENV{CXX} g++ PATHS ENV PATH NO_DEFAULT_PATH)
project(owo)
add_executable(owo src/main.cpp)
target_link_libraries(owo)

View File

@ -33,10 +33,11 @@ $ ./owo -c "Hello, world!"
```
## Building
to build the program, run the following command:
to build the program, you will need a c++ compiler. I have no idea what im doing with cmake so this uses a very basic make file that is made to build the linux and windows binaries.
If you are on windows, good luck. I have no clue how to setup g++ on windows. I would recommend using WSL or a VM. If you are on linux, you can build the program with the following commands
(assuming you have g++ installed):
```bash
$ cmake . -B build
$ cd build && make
$ make
$ ./owo "Hello, world!"
hewwo, wowld!
```

19
makefile Normal file
View File

@ -0,0 +1,19 @@
all: dirs build_unix
dirs:
@mkdir -p build/
clean:
@rm -rf build/
build_all: build_unix build_win
build_unix:
@echo "Building for unix..."
g++ -o build/owo src/main.cpp
build_win:
@echo "Building for windows..."
x86_64-w64-mingw32-g++ -o build/owo.exe src/main.cpp
.PHONY: all dirs clean build_all build_unix build_win