ded

Dramatic EDitor
Index Commits Files Refs README LICENSE
commit 774e18b567b888ba679005f5c0c894023e123c0c
parent 46de99a516e742812ea7392307b35e57aca2ced6
Author: rexim <reximkut@gmail.com>
Date:   Mon,  5 Jul 2021 03:02:59 +0700

Replace Makefile with build.sh

Diffstat:
M.github/workflows/ci.yml | 6+++---
DMakefile | 7-------
MREADME.md | 2+-
Abuild.sh | 15+++++++++++++++
4 files changed, 19 insertions(+), 11 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
@@ -15,7 +15,7 @@ jobs:
           sudo apt-get install -qq libsdl2-dev libglew-dev
       - name: build te
         run: |
-          make
+          ./build.sh
         env:
           CC: gcc
   build-linux-clang:
@@ -28,7 +28,7 @@ jobs:
           sudo apt-get install -qq libsdl2-dev libglew-dev
       - name: build te
         run: |
-          make
+          ./build.sh
         env:
           CC: clang
   build-macos:
@@ -39,7 +39,7 @@ jobs:
         run: brew install sdl2 pkg-config glew
       - name: build te
         run: |
-          make
+          ./build.sh
         env:
           CC: clang
   build-windows-msvc:
diff --git a/Makefile b/Makefile
@@ -1,7 +0,0 @@
-PKGS=sdl2 glew
-CFLAGS=-Wall -Wextra -std=c11 -pedantic -ggdb `pkg-config --cflags $(PKGS)`
-LIBS=`pkg-config --libs $(PKGS)` -lm
-SRCS=src/main.c src/la.c src/editor.c src/font.c src/sdl_extra.c src/file.c src/gl_extra.c
-
-te: $(SRCS)
-    $(CC) $(CFLAGS) -o te $(SRCS) $(LIBS)
diff --git a/README.md b/README.md
@@ -3,6 +3,6 @@
 # Quick Start
 
 ```console
-$ make
+$ ./build.sh
 $ ./te main.c
 ```
diff --git a/build.sh b/build.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+set -xe
+
+CC="${CXX:-cc}"
+PKGS="sdl2 glew"
+CFLAGS="-Wall -Wextra -std=c11 -pedantic -ggdb"
+LIBS=-lm
+SRC="src/main.c src/la.c src/editor.c src/font.c src/sdl_extra.c src/file.c src/gl_extra.c"
+
+if [ `uname` = "Darwin" ]; then
+    CFLAGS+=" -framework OpenGL"
+fi
+
+$CC $CFLAGS `pkg-config --cflags $PKGS` -o te $SRC $LIBS `pkg-config --libs $PKGS`