Implement CMake to optimize cross-compilation support #1

Merged
JackCarterSmith merged 5 commits from cmake-dev into master 2020-09-09 01:52:25 +02:00
2 changed files with 2 additions and 36 deletions
Showing only changes of commit 1ed03aa123 - Show all commits

5
.gitignore vendored
View File

@ -15,6 +15,7 @@
# Precompiled Headers
*.gch
*.pch
src/config.h
# Libraries
*.lib
@ -41,7 +42,7 @@
*.su
*.idb
*.pdb
testfiles/
samples/
# Kernel Module Compile Results
*.mod*
@ -59,5 +60,3 @@ Release/
.cproject
.project
*.launch
src/config.h

View File

@ -1,33 +0,0 @@
CC=gcc
#CFLAGS= -Wextra -Wall -O0 -g
CFLAGS= -Wall -O3
LDFLAGS= -lz -lpng
TARGET=RSE-Texture
VERSION=1.0b
SRC_DIR=src
SRC= $(wildcard $(SRC_DIR)/*.c)
INCLUDES=-I$(SRC_DIR)
BUILD_DIR=obj
OBJS= $(subst src,$(BUILD_DIR),$(SRC:%.c=%.o))
.PHONY: $(BUILD_DIR) all clean
all: clean $(BUILD_DIR) $(TARGET)
$(BUILD_DIR)/%.o: src/%.c
$(CC) $(INCLUDES) -DVERSION='"$(VERSION)"' -c -o $@ $< $(CFLAGS)
$(BUILD_DIR):
@mkdir -p $(BUILD_DIR)
$(TARGET): $(OBJS)
$(CC) -o $@_$(VERSION) $^ $(LDFLAGS)
clean:
@rm -rf $(BUILD_DIR)
@rm -f RSE-*