65 lines
1.2 KiB
Makefile
65 lines
1.2 KiB
Makefile
TARGET=$(shell basename `pwd`)
|
|
SOURCES=$(wildcard *.c)
|
|
OBJECTS=$(SOURCES:%.c=%.o)
|
|
|
|
#CFLAGS=-march=core2 -mtune=core2 -O2 -mfpmath=sse -msse4.1 -pipe
|
|
#LDFLAGS=-Wl,-O1 -Wl,--as-needed
|
|
|
|
CFLAGS+=-g $(shell pkg-config --cflags liblist)
|
|
LDFLAGS+=$(shell pkg-config --libs liblist) -lpthread
|
|
|
|
all: $(TARGET) echo-server echo-client
|
|
|
|
$(OBJECTS): $(SOURCES)
|
|
|
|
$(TARGET): $(OBJECTS)
|
|
|
|
echo-server: echo-server.o xerror.o
|
|
|
|
echo-client: echo-client.o xerror.o
|
|
|
|
clean:
|
|
$(RM) $(OBJECTS) $(TARGET) echo-server echo-client
|
|
|
|
.PHONY: all clean
|
|
|
|
# c++
|
|
#TARGET=$(shell basename `pwd`)
|
|
#SOURCES=$(wildcard *.cpp)
|
|
#OBJECTS=$(SOURCES:%.cpp=%.o)
|
|
#
|
|
#all: $(TARGET)
|
|
#
|
|
#$(OBJECTS): $(SOURCES)
|
|
#
|
|
#$(TARGET): $(OBJECTS)
|
|
# $(CXX) -o $(TARGET) $(LDFLAGS) $(OBJECTS) $(LOADLIBES) $(LDLIBS)
|
|
#
|
|
#clean:
|
|
# $(RM) $(OBJECTS) $(TARGET)
|
|
#
|
|
#.PHONY: all clean
|
|
|
|
|
|
#CC=gcc
|
|
#CFLAGS=-c -Wall
|
|
##LDFLAGS=
|
|
##INCLUDES=-I.. ./inc
|
|
##LIBS=-L. --llist
|
|
#
|
|
## all: standserver test_xmalloc
|
|
#
|
|
#all: xerror.o xmalloc.o
|
|
#
|
|
#standserver: standserver.o xmalloc.o
|
|
# $(CC) $(CFLAGS) standserver.o xmalloc.o -o standserver
|
|
#
|
|
#xmalloc.o:
|
|
# $(CC) $(CFLAGS) xmalloc.c
|
|
#
|
|
#xerror.o:
|
|
# $(CC) $(CFLAGS) xerror.c
|
|
#
|
|
#clean:
|
|
# rm -rf *.o *.gch standserver test_xmalloc
|