Let's try an actual vanilla Makefile.

This commit is contained in:
David Given
2022-06-13 23:21:06 +02:00
parent 601e220b18
commit 07b1719b17
9 changed files with 447 additions and 20 deletions

37
dep/agg/build.mk Normal file
View File

@@ -0,0 +1,37 @@
AGG_SRCS = \
dep/agg/src/agg_arrowhead.cpp \
dep/agg/src/agg_line_aa_basics.cpp \
dep/agg/src/agg_vcgen_bspline.cpp \
dep/agg/src/agg_vpgen_segmentator.cpp \
dep/agg/src/agg_color_rgba.cpp \
dep/agg/src/agg_sqrt_tables.cpp \
dep/agg/src/agg_bspline.cpp \
dep/agg/src/agg_curves.cpp \
dep/agg/src/agg_rounded_rect.cpp \
dep/agg/src/agg_vcgen_markers_term.cpp \
dep/agg/src/agg_vcgen_dash.cpp \
dep/agg/src/agg2d.cpp \
dep/agg/src/agg_trans_affine.cpp \
dep/agg/src/agg_gsv_text.cpp \
dep/agg/src/agg_vcgen_smooth_poly1.cpp \
dep/agg/src/agg_trans_single_path.cpp \
dep/agg/src/agg_vpgen_clip_polygon.cpp \
dep/agg/src/agg_embedded_raster_fonts.cpp \
dep/agg/src/agg_trans_double_path.cpp \
dep/agg/src/agg_vcgen_stroke.cpp \
dep/agg/src/agg_arc.cpp \
dep/agg/src/agg_image_filters.cpp \
dep/agg/src/agg_trans_warp_magnifier.cpp \
dep/agg/src/agg_vpgen_clip_polyline.cpp \
dep/agg/src/agg_bezier_arc.cpp \
dep/agg/src/agg_line_profile_aa.cpp \
dep/agg/src/agg_vcgen_contour.cpp \
AGG_OBJS = $(patsubst %.cpp, $(OBJDIR)/%.o, $(AGG_SRCS))
AGG_LIB = $(OBJDIR)/libagg.a
$(AGG_LIB): $(AGG_OBJS)
AGG_LDFLAGS = $(AGG_LIB)
AGG_CFLAGS = -Idep/agg/include
$(AGG_OBJS): CFLAGS += $(AGG_CFLAGS)

12
dep/fmt/build.mk Normal file
View File

@@ -0,0 +1,12 @@
ifeq ($(shell $(PKG_CONFIG) fmt; echo $$?), 0)
LIBFMT_LIB =
LIBFMT_CFLAGS := $(shell $(PKG_CONFIG) --cflags fmt)
LIBFMT_LDFLAGS := $(shell $(PKG_CONFIG) --libs fmt)
else
$(error required dependency 'fmt' missing)
endif

26
dep/libusbp/build.mk Normal file
View File

@@ -0,0 +1,26 @@
LIBUSBP_SRCS = \
dep/libusbp/src/async_in_pipe.c \
dep/libusbp/src/error.c \
dep/libusbp/src/error_hresult.c \
dep/libusbp/src/find_device.c \
dep/libusbp/src/linux/async_in_transfer_linux.c \
dep/libusbp/src/linux/device_linux.c \
dep/libusbp/src/linux/error_linux.c \
dep/libusbp/src/linux/generic_handle_linux.c \
dep/libusbp/src/linux/generic_interface_linux.c \
dep/libusbp/src/linux/list_linux.c \
dep/libusbp/src/linux/serial_port_linux.c \
dep/libusbp/src/linux/udev_linux.c \
dep/libusbp/src/linux/usbfd_linux.c \
dep/libusbp/src/list.c \
dep/libusbp/src/pipe_id.c \
dep/libusbp/src/string.c \
LIBUSBP_OBJS = $(patsubst %.c, $(OBJDIR)/%.o, $(LIBUSBP_SRCS))
$(LIBUSBP_OBJS): CFLAGS += -Idep/libusbp/src -Idep/libusbp/include
LIBUSBP_LIB = $(OBJDIR)/libusbp.a
LIBUSBP_CFLAGS = -Idep/libusbp/include $(shell pkg-config --cflags libudev)
LIBUSBP_LDFLAGS = $(LIBUSBP_LIB) $(shell pkg-config --libs libudev)
$(LIBUSBP_LIB): $(LIBUSBP_OBJS)

37
dep/stb/build.mk Normal file
View File

@@ -0,0 +1,37 @@
ifeq ($(shell $(PKG_CONFIG) stb; echo $$?), 0)
# System libstb present.
STB_LIB =
STB_CFLAGS := $(shell $(PKG_CONFIG) --cflags stb)
STB_LDFLAGS := $(shell $(PKG_CONFIG) --libs stb)
else
STB_SRCS = \
dep/libusbp/src/async_in_pipe.c \
dep/libusbp/src/error.c \
dep/libusbp/src/error_hresult.c \
dep/libusbp/src/find_device.c \
dep/libusbp/src/linux/async_in_transfer_linux.c \
dep/libusbp/src/linux/device_linux.c \
dep/libusbp/src/linux/error_linux.c \
dep/libusbp/src/linux/generic_handle_linux.c \
dep/libusbp/src/linux/generic_interface_linux.c \
dep/libusbp/src/linux/list_linux.c \
dep/libusbp/src/linux/serial_port_linux.c \
dep/libusbp/src/linux/udev_linux.c \
dep/libusbp/src/linux/usbfd_linux.c \
dep/libusbp/src/list.c \
dep/libusbp/src/pipe_id.c \
dep/libusbp/src/string.c \
STB_OBJS = $(patsubst %.c, $(OBJDIR)/%.o, $(STB_SRCS))
$(STB_OBJS): CFLAGS += -Idep/libusbp/src
STB_LIB = $(OBJDIR)/libubsp.a
$(STB_LIB): $(STB_OBJS)
STB_CFLAGS =
STB_LDFLAGS = $(STB_LIB)
endif