cs252/lab5-src/Makefile

34 lines
662 B
Makefile
Raw Normal View History

2018-10-25 14:45:56 -04:00
CXX = g++ -fPIC -pthread
NETLIBS= -lnsl -lrt
all: git-commit myhttpd daytime-server use-dlopen hello.so
daytime-server : daytime-server.o
$(CXX) -o $@ $@.o $(NETLIBS)
myhttpd : myhttpd.o
$(CXX) -o $@ $@.o $(NETLIBS) -ldl
use-dlopen: use-dlopen.o
$(CXX) -o $@ $@.o $(NETLIBS) -ldl
hello.so: hello.o
ld -G -o hello.so hello.o
%.o: %.cc
@echo 'Building $@ from $<'
$(CXX) -o $@ -c -I. $<
.PHONY: git-commit
git-commit:
git checkout
git add *.cc *.h Makefile >> .local.git.out || echo
git commit -a -m 'Commit' >> .local.git.out || echo
git push origin master
.PHONY: clean
clean:
rm -f *.o use-dlopen hello.so
rm -f *.o daytime-server myhttpd