forked from hufrea/byedpi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (24 loc) · 786 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
TARGET = ciadpi
CPPFLAGS = -D_DEFAULT_SOURCE
CFLAGS += -I. -std=c99 -Wall -Wno-unused -O2
WIN_LDFLAGS = -lws2_32 -lmswsock
HEADERS = conev.h desync.h error.h extend.h kavl.h mpool.h packets.h params.h proxy.h win_service.h
SRC = packets.c main.c conev.c proxy.c desync.c mpool.c extend.c
WIN_SRC = win_service.c
OBJ = $(SRC:.c=.o)
WIN_OBJ = $(WIN_SRC:.c=.o)
PREFIX := /usr/local
INSTALL_DIR := $(DESTDIR)$(PREFIX)/bin/
all: $(TARGET)
$(TARGET): $(OBJ)
$(CC) -o $(TARGET) $(OBJ) $(LDFLAGS)
windows: $(OBJ) $(WIN_OBJ)
$(CC) -o $(TARGET).exe $(OBJ) $(WIN_OBJ) $(WIN_LDFLAGS)
$(OBJ): $(HEADERS)
.c.o:
$(CC) $(CPPFLAGS) $(CFLAGS) -c $<
clean:
rm -f $(TARGET) $(TARGET).exe $(OBJ) $(WIN_OBJ)
install: $(TARGET)
mkdir -p $(INSTALL_DIR)
install -m 755 $(TARGET) $(INSTALL_DIR)