46 lines
1.4 KiB
Makefile
46 lines
1.4 KiB
Makefile
|
|
# Makefile для ndisasm-ru
|
||
|
|
|
||
|
|
CC = gcc
|
||
|
|
CFLAGS = -g -O2 -std=c17 -U__STRICT_ANSI__ -g3 -ggdb -fwrapv -fno-common \
|
||
|
|
-ffunction-sections -fdata-sections -fvisibility=hidden \
|
||
|
|
-Wall -W -pedantic -Werror=implicit -Werror=missing-braces \
|
||
|
|
-Werror=return-type -Werror=trigraphs -Werror=pointer-arith \
|
||
|
|
-Werror=comment -Werror=vla -Werror=strict-prototypes \
|
||
|
|
-Werror=missing-prototypes -Werror=missing-declarations \
|
||
|
|
-Wno-variadic-macros -Wno-long-long -Wno-stringop-truncation \
|
||
|
|
-Wno-shift-negative-value -DHAVE_CONFIG_H
|
||
|
|
CPPFLAGS = -Werror=attributes
|
||
|
|
INCLUDES = -Iinclude -Isrc
|
||
|
|
LDFLAGS = -Wl,--as-needed -Wl,--gc-sections
|
||
|
|
LIBS = -lz
|
||
|
|
|
||
|
|
SRCS_NDISASM = src/ndisasm.c src/zamenyator.c src/disasm.c src/sync.c \
|
||
|
|
src/prefix.c src/diserror.c
|
||
|
|
|
||
|
|
SRCS_NASMLIB = $(wildcard src/nasmlib/*.c)
|
||
|
|
SRCS_COMMON = $(wildcard src/common/*.c)
|
||
|
|
SRCS_X86 = $(wildcard src/x86/*.c)
|
||
|
|
SRCS_STDLIB = $(wildcard src/stdlib/*.c)
|
||
|
|
SRCS_OUTPUT = $(wildcard src/output/*.c)
|
||
|
|
|
||
|
|
OBJS = $(SRCS_NDISASM:.c=.o) \
|
||
|
|
$(SRCS_NASMLIB:.c=.o) \
|
||
|
|
$(SRCS_COMMON:.c=.o) \
|
||
|
|
$(SRCS_X86:.c=.o) \
|
||
|
|
$(SRCS_STDLIB:.c=.o) \
|
||
|
|
$(SRCS_OUTPUT:.c=.o)
|
||
|
|
|
||
|
|
TARGET = ndisasm-ru
|
||
|
|
|
||
|
|
all: $(TARGET)
|
||
|
|
|
||
|
|
$(TARGET): $(OBJS)
|
||
|
|
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
|
||
|
|
|
||
|
|
%.o: %.c
|
||
|
|
$(CC) -c $(CFLAGS) $(CPPFLAGS) $(INCLUDES) -o $@ $<
|
||
|
|
|
||
|
|
clean:
|
||
|
|
rm -f $(OBJS) $(TARGET)
|
||
|
|
|
||
|
|
.PHONY: all clean
|