Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # client/Makefile
- CC = gcc
- CFLAGS = -Wall -ggdb -Iinclude -I../common/include
- LDFLAGS = -lm `pkg-config --libs wayland-client`
- HDR = include/xdg-shell-server.h
- OBJ = $(wildcard ../common/build/*.o)
- PRE = include/xdg-shell-server.h
- OUT = ../wlclient
- include/xdg-shell-client.h: $(XDG_PROTO)
- wayland-scanner client-header $< $@
- include ../common/gener.mk
- test: all
- xterm -e $(OUT)
- .PHONY: test
- # common/gener.mk
- SRC += $(wildcard src/*.c)
- HDR += $(wildcard include/*.h)
- OBJ += $(subst src, build, $(SRC:.c=.o))
- DEP = $(subst src, build, $(SRC:.c=.d))
- all: $(PRE) $(DEP) $(OUT)
- ifneq ($(OUT),)
- $(OUT): $(OBJ)
- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
- endif
- build/%.d: src/%.c
- $(CC) $(CFLAGS) -MM $< | sed -e "s/^[^ \t]\+\.o:/build\/&/" > $@
- build/%.o: src/%.c build/%.d
- $(CC) $(CFLAGS) -c $< -o $@
- clean:
- rm -f $(OBJ) $(OUT)
- fullclean: clean
- rm -f $(DEP)
- .PHONY: clean fullclean all
- .SECONDARY: $(DEP)
- ifneq "$(MAKECMDGOALS)" "clean"
- include $(DEP)
- endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement