-
-
Notifications
You must be signed in to change notification settings - Fork 353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build.sh tweaks #45
base: master
Are you sure you want to change the base?
build.sh tweaks #45
Conversation
herbygillot
commented
May 9, 2020
- support environmentally-declared CFLAGS and LDFLAGS
- indicate build failure with an error exit code
- support environmentally-declared CFLAGS and LDFLAGS - indicate build failure with an error exit code
Any reason this shouldn't just be done as a makefile instead? Would be nice to have it more declarative. |
Totally agree it should be a Makefile, just wanted to make it a less intrusive change. |
As a GNU / Linux user, I agree about the use of a But what I'm wondering is the following: since it's an app that can be used on multiple environments, would not it make more sense to use something like Meson? About CMake, I have no idea how to use it, but Meson is Python and I already know how to use it so...yeah. |
CFLAGS ?= -Wall -O3 -g -std=gnu11
LDFLAGS ?= -lSDL2 -lm
CPPFLAGS ?= -Isrc
src/lib/stb/%.o: CPPFLAGS =
SRCS := $(wildcard src/*.c src/api/*.c src/lib/*.c src/lib/stb/*.c src/lib/lua52/*.c)
OBJS := $(patsubst %.c,%.o,$(SRCS))
ifeq ($(OS),Windows_NT)
OUT := lite.exe
CC := x86_64-w64-mingw32-gcc
src/lib/lua52/%.o: CPPFLAGS = -DLUA_USE_POPEN
CPPFLAGS += -Iwinlib/SDL2-2.0.10/x86_64-w64-mingw32/include
LDFLAGS += -Lwinlib/SDL2-2.0.10/x86_64-w64-mingw32/lib -lmingw32 -lSDL2main -mwindows
OBJS += res.res
else
OUT := lite
src/lib/lua52/%.o: CPPFLAGS = -DLUA_USE_POSIX
endif
$(OUT): $(OBJS)
$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) $(OUTPUT_OPTION)
res.res: res.rc
x86_64-w64-mingw32-windres $< -O coff $(OUTPUT_OPTION)
clean:
-rm -f $(OUT) $(OBJS)
.PHONY: clean (I haven't tested the Windows part, though.) |
Is it possible for you to add an install section, I can't figure out how to install it post compilation. |
I've added |