From owner-freebsd-ports@freebsd.org Fri Nov 24 21:23:38 2017 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E2F0DF1E89 for ; Fri, 24 Nov 2017 21:23:38 +0000 (UTC) (envelope-from gurenchan@gmail.com) Received: from mail-io0-x236.google.com (mail-io0-x236.google.com [IPv6:2607:f8b0:4001:c06::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2794665228 for ; Fri, 24 Nov 2017 21:23:38 +0000 (UTC) (envelope-from gurenchan@gmail.com) Received: by mail-io0-x236.google.com with SMTP id w127so30657838iow.11 for ; Fri, 24 Nov 2017 13:23:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=eMkPvM3c7g3c9RHyvaONJ4LJXSJa8+U4xqaOsOs/J1I=; b=sZVQZ1s4D0BsDvw2basQ98PsahkZL7SzxJn86WfYc9m48hppoa/oRME7B6bETfxYJZ jmrkhuKFdPZU5Xb5NjPMcLgeqtGnLoc6FDpc87tXZRM0fBeaC5ROvyjMklNtVGrslnFH hcJbwP6AJ7/4FW+S8rYLYt+Sji/TgrBg+TCCfOqEAJ7pKXjHieG/57OKjVs+wyeCH9Nf fuzZrxgiEbzJrFGUpGgeXTDrNMughMoakXXNo2yM8NMf2XP0nXkib4W5MJ85EmmxcuL8 Mw4Bn/C+JH0BrY3m/jAqS7VprxH95HMaqPnuy3nUQM8SmbcLduilNYei2SaJsLc3CSL5 ptDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=eMkPvM3c7g3c9RHyvaONJ4LJXSJa8+U4xqaOsOs/J1I=; b=ZlLFW3+Bz1Sh/TWlcM/ri3ahjOy5AH4nFZ8fu49a07FWP08cKEqikLY6vxM5bziaHg qgksZqRX/busgtAoV175MsSim0l81uXILva/tdsybres7mcCOybRGtHO2qoFBW0qc0I3 ybZW7HT+zesL757qH1qN4daJ7RnTdblzZ/oiFGZV998rBBksCgGdkcKdafaYEa35cAXj B+5FGe8RlZwCUiELIpaudZss2Fg+V4aOIZggZQIdOhTrcD8of9br0KkyC/Xt5GcW4tBA pHgu7fWKaQoDUSKb7SqgFMyzU0qqQnemsEwZBjQQKo9zN5M9tXPxVG191l2yp4BRhag9 T1OQ== X-Gm-Message-State: AJaThX7K2h7BO1kYewTHWs2T6X5+Gf/ViC9g6IhzWtG310Sipmw638VM bvobzSpy1RxuyvJxIexQM7pKWh8N1ORztbDVj0qz/g== X-Google-Smtp-Source: AGs4zMab30StSTPbBiC8OmBK+DC2nPQlfKpIda7r6YOVVgZyb/caR/JSY7VEirtC044jV/oUL5YOJIePwmFHDSb1Q6s= X-Received: by 10.107.172.193 with SMTP id v184mr16635416ioe.153.1511558617256; Fri, 24 Nov 2017 13:23:37 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.11.31 with HTTP; Fri, 24 Nov 2017 13:23:36 -0800 (PST) From: blubee blubeeme Date: Sat, 25 Nov 2017 05:23:36 +0800 Message-ID: Subject: a project with custom makefile To: FreeBSD Ports Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Nov 2017 21:23:38 -0000 I have a port that has different directories each with it's own makefile that creates some binaries in subdir/bin A typical makefile from this project looks like this: ------------------------------------------------------- # Install BIN = x11 # Flags CFLAGS = -std=c89 -pedantic -O2 `pkg-config --cflags --libs x11` SRC = main.c OBJ = $(SRC:.c=.o) $(BIN): @mkdir -p bin rm -f bin/$(BIN) $(OBJS) $(CC) $(SRC) $(CFLAGS) -o bin/$(BIN) -lX11 -lm ------------------------------------------------------- There's a few things that I need to do to this makefile to make it work first I have to remove -lX11 and -lm from the $(CC) line second I have to add `pkg-config --cflags --libs x11` to the CFLAGS line. if I go into the folder and run make, it builds and put the executable in the bin directory inside that sub folder. when I make the edits as listed above and then try to use FreeBSD Makefile. OPTIONS_DEFINE= X11 x11_DESC= X11 sample .include do-build: .if ${PORT_OPTIONS:Mx11} @(${DO_MAKE_BUILD} -C ${WRKSRC}/demo/x11/) .endif .include This DO_MAKE_BUILD command builds the executable and puts it in the subdir/bin folder but I get an error cannot open Makefile. /usr/local/include/X11/Xfuncproto.h:174:24: warning: named variadic macros are a GNU extension [-Wvariadic-macros] #define _X_NONNULL(args...) __attribute__((nonnull(args))) ^ 1 warning generated. ===> Staging for nuklear-1.0 ===> Generating temporary packing list make[2]: cannot open Makefile. Is there a straight forward way to fix this issue or do I need to write a makefile or cmake file and try to get that upstream?