aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAlexander M Pickering <alex@cogarr.net>2023-04-30 00:25:28 -0500
committerAlexander M Pickering <alex@cogarr.net>2023-04-30 00:25:28 -0500
commitfddb43101fad2b926efc80409c9d41a9948665ec (patch)
treeb6fa4c5b1874c1af1730f541236c38867924854c /Makefile
parentf7f86b7542f701351ba23a4f19cc2c946fb45caf (diff)
downloadlua-nng-fddb43101fad2b926efc80409c9d41a9948665ec.tar.gz
lua-nng-fddb43101fad2b926efc80409c9d41a9948665ec.tar.bz2
lua-nng-fddb43101fad2b926efc80409c9d41a9948665ec.zip
Update build rules
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile11
1 files changed, 8 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index c66fbe2..379442e 100644
--- a/Makefile
+++ b/Makefile
@@ -23,18 +23,23 @@ endif
src_files=$(wildcard src/*.c)
obj_files=$(src_files:src/%.c=build/%.o)
target=bin/nng.$(LIB_EXTENSION)
+installed_target=$(target:bin/%=$(INST_LIBDIR)/%)
+
+.PHONY: all install test clean
all: $(target)
$(target) : $(obj_files)
- echo "Lua_lib is: $(LUA_LIB), libs are: $(LIBS)"
$(LD) $(LADFLAGS) -o $@ $^ $(LIBS)
+$(installed_target) : $(target)
+ $(MKDIR) -p $(@D)
+ $(CP) $< $@
+
$(obj_files): build/%.o : src/%.c
$(CC) $(CAFLAGS) -c -o $@ $<
-install: $(target)
- $(CP) $(target) $(INST_LIBDIR)
+install: $(installed_target)
test:
busted --cpath=./bin/?$(SHARE_EXT)