forked from AuroraMiddleware/gtk
examples: Clean up the standalone Makefiles
Do not hardcode GCC as the compiler; use $(shell) expansion instead of backticks; split the built source into its own variable.
This commit is contained in:
parent
9ff5d2e1ac
commit
9aae351487
@ -1,7 +1,7 @@
|
|||||||
CC = gcc
|
CC ?= gcc
|
||||||
PKGCONFIG = $(shell which pkg-config)
|
PKGCONFIG = $(shell which pkg-config)
|
||||||
CFLAGS = `$(PKGCONFIG) --cflags gtk+-3.0`
|
CFLAGS = $(shell $(PKGCONFIG) --cflags gtk+-3.0)
|
||||||
LIBS = `$(PKGCONFIG) --libs gtk+-3.0`
|
LIBS = $(shell $(PKGCONFIG) --libs gtk+-3.0)
|
||||||
|
|
||||||
SRC = main.c exampleapp.c exampleappwin.c
|
SRC = main.c exampleapp.c exampleappwin.c
|
||||||
|
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
CC = gcc
|
CC ?= gcc
|
||||||
PKGCONFIG = $(shell which pkg-config)
|
PKGCONFIG = $(shell which pkg-config)
|
||||||
CFLAGS = `$(PKGCONFIG) --cflags gtk+-3.0`
|
CFLAGS = $(shell $(PKGCONFIG) --cflags gtk+-3.0)
|
||||||
LIBS = `$(PKGCONFIG) --libs gtk+-3.0`
|
LIBS = $(shell $(PKGCONFIG) --libs gtk+-3.0)
|
||||||
GLIB_COMPILE_RESOURCES = `$(PKGCONFIG) --variable=glib_compile_resources gio-2.0`
|
GLIB_COMPILE_RESOURCES = $(shell $(PKGCONFIG) --variable=glib_compile_resources gio-2.0)
|
||||||
GLIB_COMPILE_SCHEMAS = `$(PKGCONFIG) --variable=glib_compile_schemas gio-2.0`
|
GLIB_COMPILE_SCHEMAS = $(shell $(PKGCONFIG) --variable=glib_compile_schemas gio-2.0)
|
||||||
|
|
||||||
SRC = resources.c exampleapp.c exampleappwin.c exampleappprefs.c main.c
|
SRC = exampleapp.c exampleappwin.c exampleappprefs.c main.c
|
||||||
|
BUILT_SRC = resources.c
|
||||||
|
|
||||||
OBJS = $(SRC:.c=.o)
|
OBJS = $(BUILT_SRC:.c=.o) $(SRC:.c=.o)
|
||||||
|
|
||||||
all: exampleapp
|
all: exampleapp
|
||||||
|
|
||||||
@ -29,6 +30,6 @@ exampleapp: $(OBJS) gschemas.compiled
|
|||||||
clean:
|
clean:
|
||||||
rm -f org.gtk.exampleapp.gschema.valid
|
rm -f org.gtk.exampleapp.gschema.valid
|
||||||
rm -f gschemas.compiled
|
rm -f gschemas.compiled
|
||||||
rm -f resources.c
|
rm -f $(BUILT_SRC)
|
||||||
rm -f $(OBJS)
|
rm -f $(OBJS)
|
||||||
rm -f exampleapp
|
rm -f exampleapp
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
CC = gcc
|
CC ?= gcc
|
||||||
PKGCONFIG = $(shell which pkg-config)
|
PKGCONFIG = $(shell which pkg-config)
|
||||||
CFLAGS = `$(PKGCONFIG) --cflags gtk+-3.0`
|
CFLAGS = $(shell $(PKGCONFIG) --cflags gtk+-3.0)
|
||||||
LIBS = `$(PKGCONFIG) --libs gtk+-3.0`
|
LIBS = $(shell $(PKGCONFIG) --libs gtk+-3.0)
|
||||||
GLIB_COMPILE_RESOURCES = `$(PKGCONFIG) --variable=glib_compile_resources gio-2.0`
|
GLIB_COMPILE_RESOURCES = $(shell $(PKGCONFIG) --variable=glib_compile_resources gio-2.0)
|
||||||
|
|
||||||
SRC = resources.c exampleapp.c exampleappwin.c main.c
|
SRC = exampleapp.c exampleappwin.c main.c
|
||||||
|
BUILT_SRC = resources.c
|
||||||
|
|
||||||
OBJS = $(SRC:.c=.o)
|
OBJS = $(BUILT_SRC:.c=.o) $(SRC:.c=.o)
|
||||||
|
|
||||||
all: exampleapp
|
all: exampleapp
|
||||||
|
|
||||||
@ -20,6 +21,6 @@ exampleapp: $(OBJS)
|
|||||||
$(CC) -o $(@F) $(LIBS) $(OBJS)
|
$(CC) -o $(@F) $(LIBS) $(OBJS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f resources.c
|
rm -f $(BUILT_SRC)
|
||||||
rm -f $(OBJS)
|
rm -f $(OBJS)
|
||||||
rm -f exampleapp
|
rm -f exampleapp
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
CC = gcc
|
CC ?= gcc
|
||||||
PKGCONFIG = $(shell which pkg-config)
|
PKGCONFIG = $(shell which pkg-config)
|
||||||
CFLAGS = `$(PKGCONFIG) --cflags gtk+-3.0`
|
CFLAGS = $(shell $(PKGCONFIG) --cflags gtk+-3.0)
|
||||||
LIBS = `$(PKGCONFIG) --libs gtk+-3.0`
|
LIBS = $(shell $(PKGCONFIG) --libs gtk+-3.0)
|
||||||
GLIB_COMPILE_RESOURCES = `$(PKGCONFIG) --variable=glib_compile_resources gio-2.0`
|
GLIB_COMPILE_RESOURCES = $(shell $(PKGCONFIG) --variable=glib_compile_resources gio-2.0)
|
||||||
|
|
||||||
SRC = resources.c exampleapp.c exampleappwin.c main.c
|
SRC = exampleapp.c exampleappwin.c main.c
|
||||||
|
BUILT_SRC = resources.c
|
||||||
|
|
||||||
OBJS = $(SRC:.c=.o)
|
OBJS = $(BUILT_SRC:.c=.o) $(SRC:.c=.o)
|
||||||
|
|
||||||
all: exampleapp
|
all: exampleapp
|
||||||
|
|
||||||
@ -20,6 +21,6 @@ exampleapp: $(OBJS)
|
|||||||
$(CC) -o $(@F) $(LIBS) $(OBJS)
|
$(CC) -o $(@F) $(LIBS) $(OBJS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f resources.c
|
rm -f $(BUILT_SRC)
|
||||||
rm -f $(OBJS)
|
rm -f $(OBJS)
|
||||||
rm -f exampleapp
|
rm -f exampleapp
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
CC = gcc
|
CC ?= gcc
|
||||||
PKGCONFIG = $(shell which pkg-config)
|
PKGCONFIG = $(shell which pkg-config)
|
||||||
CFLAGS = `$(PKGCONFIG) --cflags gtk+-3.0`
|
CFLAGS = $(shell $(PKGCONFIG) --cflags gtk+-3.0)
|
||||||
LIBS = `$(PKGCONFIG) --libs gtk+-3.0`
|
LIBS = $(shell $(PKGCONFIG) --libs gtk+-3.0)
|
||||||
GLIB_COMPILE_RESOURCES = `$(PKGCONFIG) --variable=glib_compile_resources gio-2.0`
|
GLIB_COMPILE_RESOURCES = $(shell $(PKGCONFIG) --variable=glib_compile_resources gio-2.0)
|
||||||
|
|
||||||
SRC = resources.c exampleapp.c exampleappwin.c main.c
|
SRC = exampleapp.c exampleappwin.c main.c
|
||||||
|
BUILT_SRC = resources.c
|
||||||
|
|
||||||
OBJS = $(SRC:.c=.o)
|
OBJS = $(BUILT_SRC:.c=.o) $(SRC:.c=.o)
|
||||||
|
|
||||||
all: exampleapp
|
all: exampleapp
|
||||||
|
|
||||||
@ -20,6 +21,6 @@ exampleapp: $(OBJS)
|
|||||||
$(CC) -o $(@F) $(LIBS) $(OBJS)
|
$(CC) -o $(@F) $(LIBS) $(OBJS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f resources.c
|
rm -f $(BUILT_SRC)
|
||||||
rm -f $(OBJS)
|
rm -f $(OBJS)
|
||||||
rm -f exampleapp
|
rm -f exampleapp
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
CC = gcc
|
CC ?= gcc
|
||||||
PKGCONFIG = $(shell which pkg-config)
|
PKGCONFIG = $(shell which pkg-config)
|
||||||
CFLAGS = `$(PKGCONFIG) --cflags gtk+-3.0`
|
CFLAGS = $(shell $(PKGCONFIG) --cflags gtk+-3.0)
|
||||||
LIBS = `$(PKGCONFIG) --libs gtk+-3.0`
|
LIBS = $(shell $(PKGCONFIG) --libs gtk+-3.0)
|
||||||
GLIB_COMPILE_RESOURCES = `$(PKGCONFIG) --variable=glib_compile_resources gio-2.0`
|
GLIB_COMPILE_RESOURCES = $(shell $(PKGCONFIG) --variable=glib_compile_resources gio-2.0)
|
||||||
GLIB_COMPILE_SCHEMAS = `$(PKGCONFIG) --variable=glib_compile_schemas gio-2.0`
|
GLIB_COMPILE_SCHEMAS = $(shell $(PKGCONFIG) --variable=glib_compile_schemas gio-2.0)
|
||||||
|
|
||||||
SRC = resources.c exampleapp.c exampleappwin.c main.c
|
SRC = exampleapp.c exampleappwin.c main.c
|
||||||
|
BUILT_SRC = resources.c
|
||||||
|
|
||||||
OBJS = $(SRC:.c=.o)
|
OBJS = $(BUILT_SRC:.c=.o) $(SRC:.c=.o)
|
||||||
|
|
||||||
all: exampleapp
|
all: exampleapp
|
||||||
|
|
||||||
@ -29,6 +30,6 @@ exampleapp: $(OBJS) gschemas.compiled
|
|||||||
clean:
|
clean:
|
||||||
rm -f org.gtk.exampleapp.gschema.valid
|
rm -f org.gtk.exampleapp.gschema.valid
|
||||||
rm -f gschemas.compiled
|
rm -f gschemas.compiled
|
||||||
rm -f resources.c
|
rm -f $(BUILT_SRC)
|
||||||
rm -f $(OBJS)
|
rm -f $(OBJS)
|
||||||
rm -f exampleapp
|
rm -f exampleapp
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
CC = gcc
|
CC ?= gcc
|
||||||
PKGCONFIG = $(shell which pkg-config)
|
PKGCONFIG = $(shell which pkg-config)
|
||||||
CFLAGS = `$(PKGCONFIG) --cflags gtk+-3.0`
|
CFLAGS = $(shell $(PKGCONFIG) --cflags gtk+-3.0)
|
||||||
LIBS = `$(PKGCONFIG) --libs gtk+-3.0`
|
LIBS = $(shell $(PKGCONFIG) --libs gtk+-3.0)
|
||||||
GLIB_COMPILE_RESOURCES = `$(PKGCONFIG) --variable=glib_compile_resources gio-2.0`
|
GLIB_COMPILE_RESOURCES = $(shell $(PKGCONFIG) --variable=glib_compile_resources gio-2.0)
|
||||||
GLIB_COMPILE_SCHEMAS = `$(PKGCONFIG) --variable=glib_compile_schemas gio-2.0`
|
GLIB_COMPILE_SCHEMAS = $(shell $(PKGCONFIG) --variable=glib_compile_schemas gio-2.0)
|
||||||
|
|
||||||
SRC = resources.c exampleapp.c exampleappwin.c exampleappprefs.c main.c
|
SRC = exampleapp.c exampleappwin.c exampleappprefs.c main.c
|
||||||
|
BUILT_SRC = resources.c
|
||||||
|
|
||||||
OBJS = $(SRC:.c=.o)
|
OBJS = $(BUILT_SRC:.c=.o) $(SRC:.c=.o)
|
||||||
|
|
||||||
all: exampleapp
|
all: exampleapp
|
||||||
|
|
||||||
@ -29,6 +30,6 @@ exampleapp: $(OBJS) gschemas.compiled
|
|||||||
clean:
|
clean:
|
||||||
rm -f org.gtk.exampleapp.gschema.valid
|
rm -f org.gtk.exampleapp.gschema.valid
|
||||||
rm -f gschemas.compiled
|
rm -f gschemas.compiled
|
||||||
rm -f resources.c
|
rm -f $(BUILT_SRC)
|
||||||
rm -f $(OBJS)
|
rm -f $(OBJS)
|
||||||
rm -f exampleapp
|
rm -f exampleapp
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
CC = gcc
|
CC ?= gcc
|
||||||
PKGCONFIG = $(shell which pkg-config)
|
PKGCONFIG = $(shell which pkg-config)
|
||||||
CFLAGS = `$(PKGCONFIG) --cflags gtk+-3.0`
|
CFLAGS = $(shell $(PKGCONFIG) --cflags gtk+-3.0)
|
||||||
LIBS = `$(PKGCONFIG) --libs gtk+-3.0`
|
LIBS = $(shell $(PKGCONFIG) --libs gtk+-3.0)
|
||||||
GLIB_COMPILE_RESOURCES = `$(PKGCONFIG) --variable=glib_compile_resources gio-2.0`
|
GLIB_COMPILE_RESOURCES = $(shell $(PKGCONFIG) --variable=glib_compile_resources gio-2.0)
|
||||||
GLIB_COMPILE_SCHEMAS = `$(PKGCONFIG) --variable=glib_compile_schemas gio-2.0`
|
GLIB_COMPILE_SCHEMAS = $(shell $(PKGCONFIG) --variable=glib_compile_schemas gio-2.0)
|
||||||
|
|
||||||
SRC = resources.c exampleapp.c exampleappwin.c exampleappprefs.c main.c
|
SRC = exampleapp.c exampleappwin.c exampleappprefs.c main.c
|
||||||
|
BUILT_SRC = resources.c
|
||||||
|
|
||||||
OBJS = $(SRC:.c=.o)
|
OBJS = $(BUILT_SRC:.c=.o) $(SRC:.c=.o)
|
||||||
|
|
||||||
all: exampleapp
|
all: exampleapp
|
||||||
|
|
||||||
@ -29,6 +30,6 @@ exampleapp: $(OBJS) gschemas.compiled
|
|||||||
clean:
|
clean:
|
||||||
rm -f org.gtk.exampleapp.gschema.valid
|
rm -f org.gtk.exampleapp.gschema.valid
|
||||||
rm -f gschemas.compiled
|
rm -f gschemas.compiled
|
||||||
rm -f resources.c
|
rm -f $(BUILT_SRC)
|
||||||
rm -f $(OBJS)
|
rm -f $(OBJS)
|
||||||
rm -f exampleapp
|
rm -f exampleapp
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
CC = gcc
|
CC ?= gcc
|
||||||
PKGCONFIG = $(shell which pkg-config)
|
PKGCONFIG = $(shell which pkg-config)
|
||||||
CFLAGS = `$(PKGCONFIG) --cflags gtk+-3.0`
|
CFLAGS = $(shell $(PKGCONFIG) --cflags gtk+-3.0)
|
||||||
LIBS = `$(PKGCONFIG) --libs gtk+-3.0`
|
LIBS = $(shell $(PKGCONFIG) --libs gtk+-3.0)
|
||||||
GLIB_COMPILE_RESOURCES = `$(PKGCONFIG) --variable=glib_compile_resources gio-2.0`
|
GLIB_COMPILE_RESOURCES = $(shell $(PKGCONFIG) --variable=glib_compile_resources gio-2.0)
|
||||||
GLIB_COMPILE_SCHEMAS = `$(PKGCONFIG) --variable=glib_compile_schemas gio-2.0`
|
GLIB_COMPILE_SCHEMAS = $(shell $(PKGCONFIG) --variable=glib_compile_schemas gio-2.0)
|
||||||
|
|
||||||
SRC = resources.c exampleapp.c exampleappwin.c exampleappprefs.c main.c
|
SRC = exampleapp.c exampleappwin.c exampleappprefs.c main.c
|
||||||
|
BUILT_SRC = resources.c
|
||||||
|
|
||||||
OBJS = $(SRC:.c=.o)
|
OBJS = $(BUILT_SRC:.c=.o) $(SRC:.c=.o)
|
||||||
|
|
||||||
all: exampleapp
|
all: exampleapp
|
||||||
|
|
||||||
@ -29,6 +30,6 @@ exampleapp: $(OBJS) gschemas.compiled
|
|||||||
clean:
|
clean:
|
||||||
rm -f org.gtk.exampleapp.gschema.valid
|
rm -f org.gtk.exampleapp.gschema.valid
|
||||||
rm -f gschemas.compiled
|
rm -f gschemas.compiled
|
||||||
rm -f resources.c
|
rm -f $(BUILT_SRC)
|
||||||
rm -f $(OBJS)
|
rm -f $(OBJS)
|
||||||
rm -f exampleapp
|
rm -f exampleapp
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
CC = gcc
|
CC ?= gcc
|
||||||
PKGCONFIG = $(shell which pkg-config)
|
PKGCONFIG = $(shell which pkg-config)
|
||||||
CFLAGS = `$(PKGCONFIG) --cflags gtk+-3.0`
|
CFLAGS = $(shell $(PKGCONFIG) --cflags gtk+-3.0)
|
||||||
LIBS = `$(PKGCONFIG) --libs gtk+-3.0`
|
LIBS = $(shell $(PKGCONFIG) --libs gtk+-3.0)
|
||||||
GLIB_COMPILE_RESOURCES = `$(PKGCONFIG) --variable=glib_compile_resources gio-2.0`
|
GLIB_COMPILE_RESOURCES = $(shell $(PKGCONFIG) --variable=glib_compile_resources gio-2.0)
|
||||||
GLIB_COMPILE_SCHEMAS = `$(PKGCONFIG) --variable=glib_compile_schemas gio-2.0`
|
GLIB_COMPILE_SCHEMAS = $(shell $(PKGCONFIG) --variable=glib_compile_schemas gio-2.0)
|
||||||
|
|
||||||
SRC = resources.c exampleapp.c exampleappwin.c exampleappprefs.c main.c
|
SRC = exampleapp.c exampleappwin.c exampleappprefs.c main.c
|
||||||
|
BUILT_SRC = resources.c
|
||||||
|
|
||||||
OBJS = $(SRC:.c=.o)
|
OBJS = $(BUILT_SRC:.c=.o) $(SRC:.c=.o)
|
||||||
|
|
||||||
all: exampleapp
|
all: exampleapp
|
||||||
|
|
||||||
@ -29,6 +30,6 @@ exampleapp: $(OBJS) gschemas.compiled
|
|||||||
clean:
|
clean:
|
||||||
rm -f org.gtk.exampleapp.gschema.valid
|
rm -f org.gtk.exampleapp.gschema.valid
|
||||||
rm -f gschemas.compiled
|
rm -f gschemas.compiled
|
||||||
rm -f resources.c
|
rm -f $(BUILT_SRC)
|
||||||
rm -f $(OBJS)
|
rm -f $(OBJS)
|
||||||
rm -f exampleapp
|
rm -f exampleapp
|
||||||
|
Loading…
Reference in New Issue
Block a user