2024-11-11 18:11:46 +03:00
|
|
|
|
2023-06-03 22:52:10 +03:00
|
|
|
TARGET = ciadpi
|
|
|
|
|
2024-08-19 15:35:13 +03:00
|
|
|
CPPFLAGS = -D_DEFAULT_SOURCE
|
2024-08-07 00:03:15 +03:00
|
|
|
CFLAGS += -I. -std=c99 -Wall -Wno-unused -O2
|
|
|
|
WIN_LDFLAGS = -lws2_32 -lmswsock
|
2023-06-03 22:52:10 +03:00
|
|
|
|
2024-11-11 18:11:46 +03:00
|
|
|
HEADERS = conev.h desync.h error.h extend.h kavl.h mpool.h packets.h params.h proxy.h win_service.h
|
2024-08-07 00:03:15 +03:00
|
|
|
SRC = packets.c main.c conev.c proxy.c desync.c mpool.c extend.c
|
|
|
|
WIN_SRC = win_service.c
|
|
|
|
|
2024-11-11 18:11:46 +03:00
|
|
|
OBJ = $(SRC:.c=.o)
|
|
|
|
WIN_OBJ = $(WIN_SRC:.c=.o)
|
|
|
|
|
2024-09-11 15:53:41 +03:00
|
|
|
PREFIX := /usr/local
|
|
|
|
INSTALL_DIR := $(DESTDIR)$(PREFIX)/bin/
|
|
|
|
|
2024-11-11 18:11:46 +03:00
|
|
|
all: $(TARGET)
|
|
|
|
|
|
|
|
$(TARGET): $(OBJ)
|
|
|
|
$(CC) -o $(TARGET) $(OBJ) $(LDFLAGS)
|
|
|
|
|
|
|
|
windows: $(OBJ) $(WIN_OBJ)
|
|
|
|
$(CC) -o $(TARGET).exe $(OBJ) $(WIN_OBJ) $(WIN_LDFLAGS)
|
2024-08-07 00:03:15 +03:00
|
|
|
|
2024-11-11 18:11:46 +03:00
|
|
|
$(OBJ): $(HEADERS)
|
|
|
|
.c.o:
|
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) -c $<
|
2024-02-18 23:20:52 +03:00
|
|
|
|
2023-06-03 22:52:10 +03:00
|
|
|
clean:
|
2024-08-07 00:03:15 +03:00
|
|
|
rm -f $(TARGET) $(TARGET).exe $(OBJ) $(WIN_OBJ)
|
2024-09-11 15:53:41 +03:00
|
|
|
|
2024-11-11 18:11:46 +03:00
|
|
|
install: $(TARGET)
|
2024-09-11 15:53:41 +03:00
|
|
|
mkdir -p $(INSTALL_DIR)
|
|
|
|
install -m 755 $(TARGET) $(INSTALL_DIR)
|