BINARY_NAME=exo1
LIBOBJS=clist.o # object to put in the library
LIBRARY_NAME=libtpC
+#LDLIBS=-L. -ltpC
BUILD_TYPE=debug
# ====================================
# DO NOT CHANGE STUFF BEYOND THIS LINE
# ====================================
-all: $(LIBRARY_NAME).a $(LIBRARY_NAME).so $(BINARY_NAME)
+all: $(BINARY_NAME) $(BINARY_NAME).dynamic $(BINARY_NAME).static
CC=gcc
LD=gcc
@echo "[LD ] $@"
@$(LD) $(CFLAGS) $(LDFLAGS) $^ $(LDLIBS) -o $@
+LOCALLDLIBS=-L. -ltpC
+$(BINARY_NAME).static: $(OBJDIR)/$(BINARY_NAME).o $(LIBRARY_NAME).a
+ @echo "[LD ] $@"
+ @$(LD) $(CFLAGS) $(LDFLAGS) $^ $(LOCALLDLIBS) $(LDLIBS) -o $@
+
+$(BINARY_NAME).dynamic: $(OBJDIR)/$(BINARY_NAME).o $(LIBRARY_NAME).so
+ @echo "[LD ] $@"
+ @$(LD) $(CFLAGS) $(LDFLAGS) $^ $(LOCALLDLIBS) $(LDLIBS) -o $@
+
$(OBJDIR)/%.o: %.c $(DEPDIR)/%.d
@echo "[C ] $*"
@$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $@
@echo "[CLN]"
-@rm -r $(BUILDDIR)
-@rm $(BINARY_NAME)
+ -@rm $(BINARY_NAME).static
+ -@rm $(BINARY_NAME).dynamic
-@rm $(LIBRARY_NAME).so
-@rm $(LIBRARY_NAME).a