diff options
| author | Alexander M Pickering <alex@cogarr.net> | 2023-05-08 21:17:10 -0500 |
|---|---|---|
| committer | Alexander M Pickering <alex@cogarr.net> | 2023-05-08 21:17:10 -0500 |
| commit | e39f4f502452b5d0d75d88e5397543e3e90213a8 (patch) | |
| tree | f615ffe4c0f9ea76b6e6d7e5ab250292f6c0ea43 /Makefile | |
| parent | 41a2834903c541ff28a647836fda323e06b192a7 (diff) | |
| download | lua-nng-e39f4f502452b5d0d75d88e5397543e3e90213a8.tar.gz lua-nng-e39f4f502452b5d0d75d88e5397543e3e90213a8.tar.bz2 lua-nng-e39f4f502452b5d0d75d88e5397543e3e90213a8.zip | |
Allow appending to cflags
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -1,23 +1,25 @@ CC?=gcc LIBS?=-lnng +ALL_CFLAGS=$(CFLAGS) +ALL_LDFLAGS=$(LDFLAGS) ifdef NNG_LIBDIR - LDFLAGS+= -L$(NNG_LIBDIR) + ALL_LDFLAGS+= -L$(NNG_LIBDIR) endif ifdef LUA_LIBDIR - LDFLAGS+= -L$(LUA_LIBDIR) + ALL_LDFLAGS+= -L$(LUA_LIBDIR) endif ifdef LUA_LIB LIBS+= -l$(LUA_LIB) endif ifdef NNG_INCDIR - CFLAGS+= -I$(NNG_INCDIR) + ALL_CFLAGS+= -I$(NNG_INCDIR) endif ifdef LUA_INCDIR - CFLAGS+= -I$(LUA_INCDIR) + ALL_CFLAGS+= -I$(LUA_INCDIR) endif ifeq ($(OS), Windows_NT) - LDFLAGS+=-mwindows + ALL_LDFLAGS+=-mwindows LIBS+=-lws2_32 endif @@ -32,14 +34,14 @@ installed_target=$(target:bin/%=$(INST_LIBDIR)/%) all: $(target) $(target) : $(obj_files) - $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) + $(CC) $(ALL_LDFLAGS) -o $@ $^ $(LIBS) $(installed_target) : $(target) $(MKDIR) -p $(@D) $(CP) $< $@ $(obj_files): build/%.o : src/%.c - $(CC) $(CFLAGS) -c -o $@ $< + $(CC) $(ALL_CFLAGS) -c -o $@ $< install: $(installed_target) |
