Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # File: Makefile
- # Name: IJC DU_2 1) 2)
- # Author:
- # Make: GNU Make 4.2.1
- # Compiled C: gcc 7.3.1
- # Compiled C++: g++ 7.3.1
- #
- CC=gcc
- CXX=g++
- CFLAGS= -std=c99 -Werror -Wall -Wextra -pedantic -g
- CXXFLAGS= -std=c++11 -Wall -pedantic -g
- libsrc := $(shell ls htab_*.c)
- libsrc +=libhtab.c
- libobj := $(libsrc:.c=.o)
- libsharedobj := $(patsubst %.o,%-shared.o, $(libobj))
- .PHONY: all clean cleanall zip
- all: tail tail2 wordcount wordcount-dynamic libhtab.a libhtab.so
- tail: tail.c
- tail2: tail2.cc
- wordcount: wordcount.o io.o libhtab.a
- $(CC) $(CFLAGS) -o $@ $^
- wordcount-dynamic: wordcount.o io.o libhtab.so
- $(CC) $(CFLAGS) wordcount.o io.o -o $@ -L. -lhtab
- io.o: io.c io.h
- wordcount.o: wordcount.c htab.h io.h
- $(libobj): htab.h
- libhtab.so: $(libsharedobj)
- $(CC) $(CFLAGS) -shared -fPIC -o $@ $(libsharedobj)
- htab_%-shared.o: htab_%.c htab.h
- $(CC) $(CFLAGS) -fPIC -c $< -o $@
- libhtab-shared.o: libhtab.c htab.h
- $(CC) $(CFLAGS) -fPIC -c $< -o $@
- libhtab.a: $(libobj)
- ar crs $@ $(libobj)
- ranlib $@
- clean:
- rm -f *.o
- cleanall: clean
- rm -f wordcount-dynamic wordcount tail tail2 libhtab.a libhtab.so
- LOGIN= xpatri00
- zip: *.c *.cc *.h Makefile
- zip $(LOGIN).zip $^
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement