Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

i have a makefile/make system that uses gnu make macros;

(here http://mosermichael.github.io/cstuff/all/projects/2011/06/17... )

this saves you from repeating the same make constructs many times over, in the following example you do a static library and executable.

  1: TOPDIR=../..
  2:
  3: # - declare build targets. (built with make)
  4: TARGETS:=shlib slibuser
  5: 
  6: # - slib target is a static library -
  7: shlib_TYPE=lib
  8: shlib_SRC=slib.c
  9:
  10:
  11: # - slibuser target is a executable using slib -
  12: slibuser_TYPE=exe
  13: slibuser_SRC=slibuser.c slibuser2.c slibuser3.c
  14: slibuser_LIBS=shlib
  15:
  16: include $(TOPDIR)/rules.make



This is similar to how it was done on a project I recently worked on. It worked well enough on a project that built about 300 libraries and 200 executable. It also made it really easy to add new things.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: