[add] makefile
This commit is contained in:
28
src/Makefile
Normal file
28
src/Makefile
Normal file
@@ -0,0 +1,28 @@
|
||||
CC ?= gcc
|
||||
PKGCONFIG = $(shell which pkg-config)
|
||||
CFLAGS = $(shell $(PKGCONFIG) --cflags gtk+-3.0)
|
||||
LIBS = $(shell $(PKGCONFIG) --libs gtk+-3.0)
|
||||
GLIB_COMPILE_RESOURCES = $(shell $(PKGCONFIG) --variable=glib_compile_resources gio-2.0)
|
||||
|
||||
SRC = paperplaneapp.c paperplaneappwin.c main.c
|
||||
BUILT_SRC = resources.c
|
||||
|
||||
OBJS = $(BUILT_SRC:.c=.o) $(SRC:.c=.o)
|
||||
|
||||
all: paperplaneapp
|
||||
|
||||
resources.c: paperplaneapp.gresource.xml window.ui
|
||||
$(GLIB_COMPILE_RESOURCES) paperplaneapp.gresource.xml --target=$@ --sourcedir=. --generate-source
|
||||
|
||||
%.o: %.c
|
||||
$(CC) -c -o $(@F) $(CFLAGS) $<
|
||||
|
||||
paperplaneapp: $(OBJS)
|
||||
$(CC) -o $(@F) $(OBJS) $(LIBS)
|
||||
|
||||
clean:
|
||||
rm -f $(BUILT_SRC)
|
||||
rm -f $(OBJS)
|
||||
rm -f paperplaneapp
|
||||
|
||||
|
||||
Reference in New Issue
Block a user