mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-13 01:03:03 +01:00
Hand-written makefile
Compile toxic without autotools
This commit is contained in:
parent
52b7719180
commit
34102f72a2
40
src/Makefile
Normal file
40
src/Makefile
Normal file
@ -0,0 +1,40 @@
|
||||
SUPPORT_AUDIO ?= 0
|
||||
|
||||
LIBS = ncurses
|
||||
|
||||
CFLAGS = -std=gnu99 -pthread
|
||||
LDFLAGS = -ltoxcore -ltoxav -ltoxdns -ldl -lresolv
|
||||
DESTDIR=/usr/local
|
||||
|
||||
OBJ = chat.o chat_commands.o configdir.o dns.o execute.o
|
||||
OBJ += file_senders.o friendlist.o global_commands.o groupchat.o line_info.o
|
||||
OBJ += log.o misc_tools.o prompt.o settings.o toxic.o toxic_strings.o windows.o
|
||||
|
||||
ifeq ($(SUPPORT_AUDIO), 1)
|
||||
CFLAGS += "-D_SUPPORT_AUDIO"
|
||||
OBJ += device.o audio_call.o
|
||||
LIBS += openal
|
||||
endif
|
||||
|
||||
CFLAGS += $(shell pkg-config --cflags $(LIBS))
|
||||
LDFLAGS += $(shell pkg-config --libs $(LIBS))
|
||||
|
||||
all: toxic
|
||||
|
||||
toxic: $(OBJ)
|
||||
$(CC) $(CFLAGS) -o toxic $(OBJ) $(LDFLAGS)
|
||||
|
||||
install: toxic
|
||||
mkdir -pv $(DESTDIR)/bin
|
||||
install -m 0755 toxic $(DESTDIR)/bin
|
||||
|
||||
-include $(OBJ:.o=.d)
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) -o $*.o -c $*.c
|
||||
$(CC) -MM $(CFLAGS) $*.c > $*.d
|
||||
|
||||
clean:
|
||||
rm -rf *.d *.o toxic
|
||||
|
||||
.PHONY: clean all install
|
Loading…
Reference in New Issue
Block a user