Version v0.3.41 - -m Suppress miniz library warnings, auto-select pad when only one available
This commit is contained in:
31
Makefile
31
Makefile
@@ -1,25 +1,40 @@
|
||||
CC = gcc
|
||||
CFLAGS = -Wall -Wextra -std=c99 -Isrc -Isrc/miniz -Isrc/microtar
|
||||
CFLAGS_MINIZ = -Wall -Wextra -std=c99 -D_POSIX_C_SOURCE=200112L -Isrc -Isrc/miniz -Isrc/microtar -Wno-unused-function -Wno-implicit-function-declaration
|
||||
LIBS = -lm
|
||||
LIBS_STATIC = -static -lm
|
||||
ARCH = $(shell uname -m)
|
||||
TARGET = build/otp-$(ARCH)
|
||||
SOURCES = $(wildcard src/*.c) $(wildcard src/miniz/*.c) $(wildcard src/microtar/*.c)
|
||||
SOURCES = $(wildcard src/*.c)
|
||||
MINIZ_SOURCES = $(wildcard src/miniz/*.c)
|
||||
MICROTAR_SOURCES = $(wildcard src/microtar/*.c)
|
||||
OBJS = $(SOURCES:.c=.o)
|
||||
MINIZ_OBJS = $(MINIZ_SOURCES:.c=.o)
|
||||
MICROTAR_OBJS = $(MICROTAR_SOURCES:.c=.o)
|
||||
ALL_OBJS = $(OBJS) $(MINIZ_OBJS) $(MICROTAR_OBJS)
|
||||
|
||||
# Default build target
|
||||
$(TARGET): $(OBJS)
|
||||
$(TARGET): $(ALL_OBJS)
|
||||
@mkdir -p build
|
||||
$(CC) $(CFLAGS) -o $(TARGET) $(OBJS) $(LIBS)
|
||||
@rm -f $(OBJS)
|
||||
$(CC) $(CFLAGS) -o $(TARGET) $(ALL_OBJS) $(LIBS)
|
||||
@rm -f $(ALL_OBJS)
|
||||
|
||||
# Static linking target
|
||||
static: $(OBJS)
|
||||
static: $(ALL_OBJS)
|
||||
@mkdir -p build
|
||||
$(CC) $(CFLAGS) -o $(TARGET) $(OBJS) $(LIBS_STATIC)
|
||||
@rm -f $(OBJS)
|
||||
$(CC) $(CFLAGS) -o $(TARGET) $(ALL_OBJS) $(LIBS_STATIC)
|
||||
@rm -f $(ALL_OBJS)
|
||||
|
||||
%.o: %.c
|
||||
# Compile main source files with full warnings
|
||||
src/%.o: src/%.c
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
# Compile miniz library files with reduced warnings
|
||||
src/miniz/%.o: src/miniz/%.c
|
||||
$(CC) $(CFLAGS_MINIZ) -c $< -o $@
|
||||
|
||||
# Compile microtar library files normally
|
||||
src/microtar/%.o: src/microtar/%.c
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
clean:
|
||||
|
||||
Reference in New Issue
Block a user